Compare commits
1 Commits
@@ -1,41 +0,0 @@
|
|||||||
root: true
|
|
||||||
parser: '@typescript-eslint/parser'
|
|
||||||
parserOptions:
|
|
||||||
project: tsconfig.json
|
|
||||||
plugins:
|
|
||||||
- '@typescript-eslint'
|
|
||||||
- prettier
|
|
||||||
extends:
|
|
||||||
- eslint:recommended
|
|
||||||
- plugin:@typescript-eslint/recommended
|
|
||||||
- plugin:@typescript-eslint/recommended-requiring-type-checking
|
|
||||||
- plugin:prettier/recommended
|
|
||||||
rules:
|
|
||||||
'prettier/prettier': [1]
|
|
||||||
'@typescript-eslint/array-type': [1, { default: array-simple }]
|
|
||||||
'@typescript-eslint/explicit-function-return-type':
|
|
||||||
- 2
|
|
||||||
- allowExpressions: true
|
|
||||||
'@typescript-eslint/no-extraneous-class':
|
|
||||||
- 1
|
|
||||||
- allowWithDecorator: true
|
|
||||||
allowStaticOnly: true
|
|
||||||
'@typescript-eslint/no-parameter-properties':
|
|
||||||
- 1
|
|
||||||
- allows: [protected readonly, private readonly, public readonly, readonly]
|
|
||||||
'@typescript-eslint/no-throw-literal': [2]
|
|
||||||
'no-unused-vars': [0]
|
|
||||||
'@typescript-eslint/no-unused-vars':
|
|
||||||
- 1
|
|
||||||
- varsIgnorePattern: ^_
|
|
||||||
argsIgnorePattern: ^_
|
|
||||||
'@typescript-eslint/prefer-for-of': [1]
|
|
||||||
'@typescript-eslint/prefer-function-type': [1]
|
|
||||||
'@typescript-eslint/prefer-nullish-coalescing': [1]
|
|
||||||
'@typescript-eslint/prefer-optional-chain': [1]
|
|
||||||
'@typescript-eslint/ban-types':
|
|
||||||
- 1
|
|
||||||
- types:
|
|
||||||
object: false
|
|
||||||
no-void: [1, { allowAsStatement: true }]
|
|
||||||
eqeqeq: [1, smart]
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
name: checkin
|
|
||||||
|
|
||||||
on:
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
checkin:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: install
|
|
||||||
run: yarn install
|
|
||||||
- name: build
|
|
||||||
run: yarn build
|
|
||||||
- name: test
|
|
||||||
run: yarn test
|
|
||||||
- name: release
|
|
||||||
run: yarn release
|
|
||||||
- name: 'check for uncommitted changes'
|
|
||||||
# Ensure no changes
|
|
||||||
run: |
|
|
||||||
git add .
|
|
||||||
if ! git diff --cached --color=always --exit-code -- . ':!node_modules'; then
|
|
||||||
echo "::error::Found changed files after build. Please run 'yarn release' and check in all changes."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
name: test
|
|
||||||
|
|
||||||
on:
|
|
||||||
- push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
||||||
version: [latest, branch@master, branch@dev]
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: xmake-io/github-action-setup-xmake@master
|
|
||||||
with:
|
|
||||||
xmake-version: ${{ matrix.version }}
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
xmake --version
|
|
||||||
xmake create -P test
|
|
||||||
xmake build -P test
|
|
||||||
xmake run -P test
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
!node_modules
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
singleQuote: true
|
|
||||||
trailingComma: all
|
|
||||||
tabWidth: 2
|
|
||||||
endOfLine: lf
|
|
||||||
printWidth: 120
|
|
||||||
overrides:
|
|
||||||
- files:
|
|
||||||
- '*.js'
|
|
||||||
- '*.ts'
|
|
||||||
options:
|
|
||||||
tabWidth: 4
|
|
||||||
Vendored
-19
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"npm.packageManager": "yarn",
|
|
||||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"],
|
|
||||||
"eslint.enable": true,
|
|
||||||
"files.autoSave": "off",
|
|
||||||
"eslint.format.enable": true,
|
|
||||||
"editor.tabSize": 4,
|
|
||||||
"editor.formatOnSave": false,
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.fixAll.eslint": true
|
|
||||||
},
|
|
||||||
"[typescript]": {
|
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
||||||
},
|
|
||||||
"[javascript]": {
|
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
||||||
},
|
|
||||||
"git.ignoreLimitWarning": true
|
|
||||||
}
|
|
||||||
@@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
# GitHub Action - Setup xmake
|
|
||||||
|
|
||||||
[](https://github.com/xmake-io/github-action-setup-xmake/actions)
|
|
||||||
[](https://github.com/marketplace/actions/setup-xmake)
|
|
||||||
|
|
||||||
Set up your GitHub Actions workflow with a specific version of xmake
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
See [action.yml](./action.yml).
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
Use latest version:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
|
||||||
with:
|
|
||||||
xmake-version: latest
|
|
||||||
```
|
|
||||||
|
|
||||||
Use specified version:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
|
||||||
with:
|
|
||||||
xmake-version: '2.5.3'
|
|
||||||
```
|
|
||||||
|
|
||||||
Use specified branch:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
|
||||||
with:
|
|
||||||
xmake-version: branch@master
|
|
||||||
```
|
|
||||||
|
|
||||||
Use semver:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
|
||||||
with:
|
|
||||||
xmake-version: '>=2.2.6 <=2.5.3'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
### Prepare development environment
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Draft a new release
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn release
|
|
||||||
git add .
|
|
||||||
yarn version
|
|
||||||
|
|
||||||
# for a minor version or patch of v1
|
|
||||||
git tag --delete v1
|
|
||||||
git tag v1
|
|
||||||
|
|
||||||
git push origin master
|
|
||||||
git push --tags --force
|
|
||||||
```
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
| Version | Supported |
|
|
||||||
| ------- | ------------------ |
|
|
||||||
| 1.0.x | :white_check_mark: |
|
|
||||||
|
|
||||||
<!--
|
|
||||||
| 5.0.x | :x: |
|
|
||||||
| 4.0.x | :white_check_mark: |
|
|
||||||
| < 4.0 | :x: |
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
Use github issues to report a vulnerability.
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
name: setup xmake
|
|
||||||
description: Set up a xmake environment and add it to the PATH
|
|
||||||
author: OpportunityLiu
|
|
||||||
branding:
|
|
||||||
icon: play
|
|
||||||
color: green
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
xmake-version:
|
|
||||||
required: true
|
|
||||||
default: latest
|
|
||||||
description: The version to use. Should be a semver range or 'latest'. Or use [{repository}#]branch@{branch_name} to select a branch.
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: 'node16'
|
|
||||||
main: 'dist/index.js'
|
|
||||||
Vendored
-57
@@ -1,57 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.cleanup = exports.create = exports.lsRemote = void 0;
|
|
||||||
const exec_1 = require("@actions/exec");
|
|
||||||
const io = require("@actions/io");
|
|
||||||
const os = require("os");
|
|
||||||
const path = require("path");
|
|
||||||
function makeOpt(ref) {
|
|
||||||
return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) };
|
|
||||||
}
|
|
||||||
const repoUrl = (repo) => `https://github.com/${repo}.git`;
|
|
||||||
async function lsRemote(repo) {
|
|
||||||
let out = '';
|
|
||||||
await exec_1.exec('git', ['ls-remote', repoUrl(repo)], {
|
|
||||||
silent: true,
|
|
||||||
listeners: {
|
|
||||||
stdout: (d) => (out += d.toString()),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const data = { heads: {}, tags: {}, pull: {} };
|
|
||||||
out.split('\n').forEach((line) => {
|
|
||||||
const [ref, tag] = line.trim().split('\t');
|
|
||||||
if (ref && tag && tag.startsWith('refs/')) {
|
|
||||||
const tagPath = tag.split('/').splice(1);
|
|
||||||
let ldata = data;
|
|
||||||
for (let i = 0; i < tagPath.length - 1; i++) {
|
|
||||||
const seg = tagPath[i];
|
|
||||||
if (typeof ldata[seg] === 'object') {
|
|
||||||
ldata = ldata[seg];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ldata = ldata[seg] = {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ldata[tagPath[tagPath.length - 1]] = ref;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
exports.lsRemote = lsRemote;
|
|
||||||
async function create(repo, ref) {
|
|
||||||
const opt = makeOpt(ref);
|
|
||||||
await io.rmRF(opt.cwd);
|
|
||||||
await io.mkdirP(opt.cwd);
|
|
||||||
await exec_1.exec('git', ['init'], opt);
|
|
||||||
await exec_1.exec('git', ['remote', 'add', 'origin', repoUrl(repo)], opt);
|
|
||||||
await exec_1.exec('git', ['fetch', 'origin', '+refs/pull/*:refs/remotes/origin/pull/*', '+refs/heads/*:refs/remotes/origin/*'], opt);
|
|
||||||
await exec_1.exec('git', ['checkout', ref], opt);
|
|
||||||
await exec_1.exec('git', ['submodule', 'update', '--init', '--recursive'], opt);
|
|
||||||
return opt.cwd;
|
|
||||||
}
|
|
||||||
exports.create = create;
|
|
||||||
async function cleanup(ref) {
|
|
||||||
const opt = makeOpt(ref);
|
|
||||||
await io.rmRF(opt.cwd);
|
|
||||||
}
|
|
||||||
exports.cleanup = cleanup;
|
|
||||||
Vendored
-26
@@ -1,26 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const core = require("@actions/core");
|
|
||||||
const exec_1 = require("@actions/exec");
|
|
||||||
const os = require("os");
|
|
||||||
const versions_1 = require("./versions");
|
|
||||||
const win_install_1 = require("./win-install");
|
|
||||||
const unix_install_1 = require("./unix-install");
|
|
||||||
async function run() {
|
|
||||||
try {
|
|
||||||
const version = await versions_1.selectVersion();
|
|
||||||
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
|
|
||||||
const latest = await versions_1.selectVersion('latest');
|
|
||||||
await win_install_1.winInstall(version, latest);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
await unix_install_1.unixInstall(version);
|
|
||||||
}
|
|
||||||
await exec_1.exec('xmake --version');
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
const ex = error;
|
|
||||||
core.setFailed(ex.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
run().catch((e) => core.error(e));
|
|
||||||
Vendored
-17
@@ -1,17 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.Repo = exports.Sha = void 0;
|
|
||||||
function Sha(sha) {
|
|
||||||
sha = sha.trim().toLowerCase();
|
|
||||||
if (!/^[a-f0-9]{40}$/g.test(sha))
|
|
||||||
throw new Error(`Invalid sha value ${sha}`);
|
|
||||||
return sha;
|
|
||||||
}
|
|
||||||
exports.Sha = Sha;
|
|
||||||
function Repo(repo) {
|
|
||||||
repo = repo.trim();
|
|
||||||
if (!/^([^/#]+\/[^/#]+)$/g.test(repo))
|
|
||||||
throw new Error(`Invalid repo value ${repo}`);
|
|
||||||
return repo;
|
|
||||||
}
|
|
||||||
exports.Repo = Repo;
|
|
||||||
Vendored
-47
@@ -1,47 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.unixInstall = void 0;
|
|
||||||
const core = require("@actions/core");
|
|
||||||
const exec_1 = require("@actions/exec");
|
|
||||||
const io = require("@actions/io");
|
|
||||||
const toolCache = require("@actions/tool-cache");
|
|
||||||
const os = require("os");
|
|
||||||
const path = require("path");
|
|
||||||
const semver = require("semver");
|
|
||||||
const git = require("./git");
|
|
||||||
async function install(sourceDir, binDir) {
|
|
||||||
await exec_1.exec('make', ['build'], { cwd: sourceDir });
|
|
||||||
await exec_1.exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir });
|
|
||||||
}
|
|
||||||
async function unixInstall(version) {
|
|
||||||
let toolDir;
|
|
||||||
if (version.type !== 'local') {
|
|
||||||
const ver = version.version;
|
|
||||||
toolDir = toolCache.find('xmake', ver);
|
|
||||||
if (!toolDir) {
|
|
||||||
const sourceDir = await core.group(`download xmake ${String(version)}`, () => git.create(version.repo, version.sha));
|
|
||||||
toolDir = await core.group(`install xmake ${String(version)}`, async () => {
|
|
||||||
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
|
|
||||||
await install(sourceDir, binDir);
|
|
||||||
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
|
|
||||||
await io.rmRF(binDir);
|
|
||||||
await git.cleanup(version.sha);
|
|
||||||
return cacheDir;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
toolDir = await core.group(`install local xmake at '${version.path}'`, async () => {
|
|
||||||
const binDir = path.join(os.tmpdir(), `xmake-${Date.now()}`);
|
|
||||||
await install(version.path, binDir);
|
|
||||||
return binDir;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (version.type !== 'tags' || semver.gt(version.version, '2.3.1')) {
|
|
||||||
core.addPath(path.join(toolDir, 'bin'));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.addPath(path.join(toolDir, 'share', 'xmake'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.unixInstall = unixInstall;
|
|
||||||
Vendored
-153
@@ -1,153 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
||||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
||||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
||||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
||||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
||||||
};
|
|
||||||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
||||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
||||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
||||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
||||||
};
|
|
||||||
var _GitVersionImpl_string;
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.selectVersion = void 0;
|
|
||||||
const core = require("@actions/core");
|
|
||||||
const semver = require("semver");
|
|
||||||
const git_1 = require("./git");
|
|
||||||
const interfaces_1 = require("./interfaces");
|
|
||||||
const p = require("path");
|
|
||||||
const DEFAULT_REPO = interfaces_1.Repo('xmake-io/xmake');
|
|
||||||
const VERSIONS = new Map();
|
|
||||||
async function getVersions(repo) {
|
|
||||||
const cache = VERSIONS.get(repo);
|
|
||||||
if (cache)
|
|
||||||
return cache;
|
|
||||||
const result = await git_1.lsRemote(repo);
|
|
||||||
VERSIONS.set(repo, result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
class GitVersionImpl {
|
|
||||||
constructor(repo, version, sha, type, toString) {
|
|
||||||
this.repo = repo;
|
|
||||||
this.version = version;
|
|
||||||
this.sha = sha;
|
|
||||||
this.type = type;
|
|
||||||
_GitVersionImpl_string.set(this, void 0);
|
|
||||||
__classPrivateFieldSet(this, _GitVersionImpl_string, toString, "f");
|
|
||||||
}
|
|
||||||
toString() {
|
|
||||||
return __classPrivateFieldGet(this, _GitVersionImpl_string, "f");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_GitVersionImpl_string = new WeakMap();
|
|
||||||
class LocalVersionImpl {
|
|
||||||
constructor(path) {
|
|
||||||
this.path = path;
|
|
||||||
this.type = 'local';
|
|
||||||
this.path = p.resolve(path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function selectBranch(repo, branch) {
|
|
||||||
const versions = await getVersions(repo);
|
|
||||||
if (branch in versions.heads) {
|
|
||||||
return new GitVersionImpl(repo, branch, versions.heads[branch], 'heads', `branch ${branch}`);
|
|
||||||
}
|
|
||||||
throw new Error(`Branch ${branch} not found`);
|
|
||||||
}
|
|
||||||
async function selectPr(repo, pr) {
|
|
||||||
var _a;
|
|
||||||
const versions = await getVersions(repo);
|
|
||||||
if (pr in versions.pull) {
|
|
||||||
const prHeads = versions.pull[pr];
|
|
||||||
const sha = (_a = prHeads.merge) !== null && _a !== void 0 ? _a : prHeads.head;
|
|
||||||
if (sha) {
|
|
||||||
return new GitVersionImpl(repo, `pr#${pr}`, sha, 'pull', `pull request #${pr}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new Error(`Pull requrest #${pr} not found`);
|
|
||||||
}
|
|
||||||
async function selectSemver(repo, version) {
|
|
||||||
const v = new semver.Range(version);
|
|
||||||
if (!v) {
|
|
||||||
throw new Error(`Invalid semver`);
|
|
||||||
}
|
|
||||||
const versions = await getVersions(repo);
|
|
||||||
const ver = semver.maxSatisfying(Object.keys(versions.tags), v);
|
|
||||||
if (!ver) {
|
|
||||||
throw new Error(`No matched releases of xmake-version ${v.format()}`);
|
|
||||||
}
|
|
||||||
const sha = versions.tags[ver];
|
|
||||||
return new GitVersionImpl(repo, ver, sha, 'tags', ver);
|
|
||||||
}
|
|
||||||
async function selectSha(repo, sha) {
|
|
||||||
var _a;
|
|
||||||
const shaValue = interfaces_1.Sha(sha);
|
|
||||||
const versions = await getVersions(repo);
|
|
||||||
for (const branch in versions.heads) {
|
|
||||||
if (versions.heads[branch] === shaValue) {
|
|
||||||
return selectBranch(repo, branch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const tag in versions.tags) {
|
|
||||||
if (versions.tags[tag] === shaValue) {
|
|
||||||
return selectSemver(repo, tag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const pr in versions.pull) {
|
|
||||||
const prData = versions.pull[pr];
|
|
||||||
if (((_a = prData.merge) !== null && _a !== void 0 ? _a : prData.head) === shaValue) {
|
|
||||||
return selectPr(repo, Number.parseInt(pr));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.resolve(new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`));
|
|
||||||
}
|
|
||||||
async function selectVersion(version) {
|
|
||||||
version = (version !== null && version !== void 0 ? version : core.getInput('xmake-version')) || 'latest';
|
|
||||||
if (version.toLowerCase() === 'latest')
|
|
||||||
version = '';
|
|
||||||
let repo = DEFAULT_REPO;
|
|
||||||
let ret;
|
|
||||||
if (version.startsWith('local#')) {
|
|
||||||
const path = version.slice('local#'.length);
|
|
||||||
ret = new LocalVersionImpl(path);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const match = /^([^/#]+\/[^/#]+)#(.+)$/.exec(version);
|
|
||||||
if (match) {
|
|
||||||
repo = interfaces_1.Repo(match[1]);
|
|
||||||
version = match[2];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (version.startsWith('branch@')) {
|
|
||||||
const branch = version.substr('branch@'.length);
|
|
||||||
ret = await selectBranch(repo, branch);
|
|
||||||
}
|
|
||||||
if (version.startsWith('pr@')) {
|
|
||||||
const pr = Number.parseInt(version.substr('pr@'.length));
|
|
||||||
if (Number.isNaN(pr) || pr <= 0) {
|
|
||||||
throw new Error(`Invalid pull requrest ${version.substr('pr@'.length)}, should be a positive integer`);
|
|
||||||
}
|
|
||||||
ret = await selectPr(repo, pr);
|
|
||||||
}
|
|
||||||
if (version.startsWith('sha@')) {
|
|
||||||
const sha = version.substr('sha@'.length);
|
|
||||||
ret = await selectSha(repo, sha);
|
|
||||||
}
|
|
||||||
if (semver.validRange(version)) {
|
|
||||||
ret = await selectSemver(repo, version);
|
|
||||||
}
|
|
||||||
if (!ret) {
|
|
||||||
throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`);
|
|
||||||
}
|
|
||||||
if (ret.type === 'local') {
|
|
||||||
core.info(`Use local xmake at '${ret.path}'`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` +
|
|
||||||
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''));
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
exports.selectVersion = selectVersion;
|
|
||||||
Vendored
-70
@@ -1,70 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.winInstall = void 0;
|
|
||||||
const core = require("@actions/core");
|
|
||||||
const exec_1 = require("@actions/exec");
|
|
||||||
const io = require("@actions/io");
|
|
||||||
const toolCache = require("@actions/tool-cache");
|
|
||||||
const os = require("os");
|
|
||||||
const path = require("path");
|
|
||||||
const semver = require("semver");
|
|
||||||
function getInstallerUrl(version, latest) {
|
|
||||||
const ver = version.version;
|
|
||||||
switch (version.type) {
|
|
||||||
case 'heads': {
|
|
||||||
const arch = os.arch() === 'x64' ? 'win64' : 'win32';
|
|
||||||
const latestver = latest.version;
|
|
||||||
return `https://github.com/xmake-io/xmake/releases/download/${latestver}/xmake-${ver}.${arch}.exe`;
|
|
||||||
}
|
|
||||||
case 'pull': {
|
|
||||||
throw new Error('PR builds for windows is not supported');
|
|
||||||
}
|
|
||||||
case 'sha': {
|
|
||||||
throw new Error('Sha builds for windows is not supported');
|
|
||||||
}
|
|
||||||
case 'tags': {
|
|
||||||
const arch = os.arch() === 'x64' ? 'win64' : 'win32';
|
|
||||||
return semver.gt(ver, '2.2.6')
|
|
||||||
? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe`
|
|
||||||
: `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.exe`;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
const _ = version.type;
|
|
||||||
throw new Error('Unknown version type');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function winInstall(version, latest) {
|
|
||||||
if (version.type === 'local' || latest.type === 'local') {
|
|
||||||
throw new Error('Local builds for windows is not supported');
|
|
||||||
}
|
|
||||||
const ver = version.version;
|
|
||||||
let toolDir = toolCache.find('xmake', ver);
|
|
||||||
if (!toolDir) {
|
|
||||||
const installer = await core.group(`download xmake ${String(version)}`, async () => {
|
|
||||||
const url = getInstallerUrl(version, latest);
|
|
||||||
core.info(`downloading from ${url}`);
|
|
||||||
const file = await toolCache.downloadTool(url);
|
|
||||||
const exe = path.format({
|
|
||||||
...path.parse(file),
|
|
||||||
ext: '.exe',
|
|
||||||
base: undefined,
|
|
||||||
});
|
|
||||||
await io.mv(file, exe);
|
|
||||||
core.info(`downloaded to ${exe}`);
|
|
||||||
return exe;
|
|
||||||
});
|
|
||||||
toolDir = await core.group(`install xmake ${String(version)}`, async () => {
|
|
||||||
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
|
|
||||||
core.info(`installing to ${binDir}`);
|
|
||||||
await exec_1.exec(`"${installer}" /NOADMIN /S /D=${binDir}`);
|
|
||||||
core.info(`installed to ${binDir}`);
|
|
||||||
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
|
|
||||||
await io.rmRF(binDir);
|
|
||||||
await io.rmRF(installer);
|
|
||||||
return cacheDir;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
core.addPath(toolDir);
|
|
||||||
}
|
|
||||||
exports.winInstall = winInstall;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
preset: 'ts-jest',
|
|
||||||
testEnvironment: 'node',
|
|
||||||
};
|
|
||||||
-549
@@ -1,549 +0,0 @@
|
|||||||
{
|
|
||||||
"systemParams": "darwin-x64-102",
|
|
||||||
"modulesFolders": [
|
|
||||||
"node_modules"
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
"production"
|
|
||||||
],
|
|
||||||
"linkedModules": [],
|
|
||||||
"topLevelPatterns": [
|
|
||||||
"@actions/core@^1.9.1",
|
|
||||||
"@actions/exec@^1.1.0",
|
|
||||||
"@actions/io@^1.1.1",
|
|
||||||
"@actions/tool-cache@^1.7.1",
|
|
||||||
"@types/jest@^26.0.24",
|
|
||||||
"@types/node@^16.3.2",
|
|
||||||
"@types/semver@^7.3.7",
|
|
||||||
"@typescript-eslint/eslint-plugin@^4.28.3",
|
|
||||||
"@typescript-eslint/parser@^4.28.3",
|
|
||||||
"eslint-config-prettier@^8.3.0",
|
|
||||||
"eslint-plugin-prettier@^3.4.0",
|
|
||||||
"eslint@^7.30.0",
|
|
||||||
"jest@^27.0.6",
|
|
||||||
"prettier@^2.3.2",
|
|
||||||
"rimraf@^3.0.2",
|
|
||||||
"semver@^7.3.5",
|
|
||||||
"ts-jest@^27.0.3",
|
|
||||||
"type-fest@^1.2.2",
|
|
||||||
"typescript@^4.3.5"
|
|
||||||
],
|
|
||||||
"lockfileEntries": {
|
|
||||||
"@actions/core@^1.2.6": "https://registry.yarnpkg.com/@actions/core/-/core-1.9.1.tgz#97c0201b1f9856df4f7c3a375cdcdb0c2a2f750b",
|
|
||||||
"@actions/core@^1.9.1": "https://registry.yarnpkg.com/@actions/core/-/core-1.9.1.tgz#97c0201b1f9856df4f7c3a375cdcdb0c2a2f750b",
|
|
||||||
"@actions/exec@^1.0.0": "https://registry.nlark.com/@actions/exec/download/@actions/exec-1.1.0.tgz#53441d968e56d2fec69ad3f15773d4d94e01162c",
|
|
||||||
"@actions/exec@^1.1.0": "https://registry.nlark.com/@actions/exec/download/@actions/exec-1.1.0.tgz#53441d968e56d2fec69ad3f15773d4d94e01162c",
|
|
||||||
"@actions/http-client@^1.0.8": "https://registry.nlark.com/@actions/http-client/download/@actions/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0",
|
|
||||||
"@actions/http-client@^2.0.1": "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.0.1.tgz#873f4ca98fe32f6839462a6f046332677322f99c",
|
|
||||||
"@actions/io@^1.0.1": "https://registry.nlark.com/@actions/io/download/@actions/io-1.1.1.tgz#4a157406309e212ab27ed3ae30e8c1d641686a66",
|
|
||||||
"@actions/io@^1.1.1": "https://registry.nlark.com/@actions/io/download/@actions/io-1.1.1.tgz#4a157406309e212ab27ed3ae30e8c1d641686a66",
|
|
||||||
"@actions/tool-cache@^1.7.1": "https://registry.nlark.com/@actions/tool-cache/download/@actions/tool-cache-1.7.1.tgz#f9f4f822cb639da6facdf3e22ea571361ab26f92",
|
|
||||||
"@babel/code-frame@7.12.11": "https://registry.nlark.com/@babel/code-frame/download/@babel/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f",
|
|
||||||
"@babel/code-frame@^7.12.13": "https://registry.nlark.com/@babel/code-frame/download/@babel/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb",
|
|
||||||
"@babel/code-frame@^7.14.5": "https://registry.nlark.com/@babel/code-frame/download/@babel/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb",
|
|
||||||
"@babel/compat-data@^7.14.5": "https://registry.nlark.com/@babel/compat-data/download/@babel/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08",
|
|
||||||
"@babel/core@^7.1.0": "https://registry.nlark.com/@babel/core/download/@babel/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab",
|
|
||||||
"@babel/core@^7.7.2": "https://registry.nlark.com/@babel/core/download/@babel/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab",
|
|
||||||
"@babel/core@^7.7.5": "https://registry.nlark.com/@babel/core/download/@babel/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab",
|
|
||||||
"@babel/generator@^7.14.5": "https://registry.nlark.com/@babel/generator/download/@babel/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785",
|
|
||||||
"@babel/generator@^7.7.2": "https://registry.nlark.com/@babel/generator/download/@babel/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785",
|
|
||||||
"@babel/helper-compilation-targets@^7.14.5": "https://registry.nlark.com/@babel/helper-compilation-targets/download/@babel/helper-compilation-targets-7.14.5.tgz#7a99c5d0967911e972fe2c3411f7d5b498498ecf",
|
|
||||||
"@babel/helper-function-name@^7.14.5": "https://registry.nlark.com/@babel/helper-function-name/download/@babel/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4",
|
|
||||||
"@babel/helper-get-function-arity@^7.14.5": "https://registry.nlark.com/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815",
|
|
||||||
"@babel/helper-hoist-variables@^7.14.5": "https://registry.nlark.com/@babel/helper-hoist-variables/download/@babel/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d",
|
|
||||||
"@babel/helper-member-expression-to-functions@^7.14.5": "https://registry.nlark.com/@babel/helper-member-expression-to-functions/download/@babel/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970",
|
|
||||||
"@babel/helper-module-imports@^7.14.5": "https://registry.nlark.com/@babel/helper-module-imports/download/@babel/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3",
|
|
||||||
"@babel/helper-module-transforms@^7.14.5": "https://registry.nlark.com/@babel/helper-module-transforms/download/@babel/helper-module-transforms-7.14.5.tgz#7de42f10d789b423eb902ebd24031ca77cb1e10e",
|
|
||||||
"@babel/helper-optimise-call-expression@^7.14.5": "https://registry.nlark.com/@babel/helper-optimise-call-expression/download/@babel/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c",
|
|
||||||
"@babel/helper-plugin-utils@^7.0.0": "https://registry.nlark.com/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9",
|
|
||||||
"@babel/helper-plugin-utils@^7.10.4": "https://registry.nlark.com/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9",
|
|
||||||
"@babel/helper-plugin-utils@^7.12.13": "https://registry.nlark.com/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9",
|
|
||||||
"@babel/helper-plugin-utils@^7.14.5": "https://registry.nlark.com/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9",
|
|
||||||
"@babel/helper-plugin-utils@^7.8.0": "https://registry.nlark.com/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9",
|
|
||||||
"@babel/helper-replace-supers@^7.14.5": "https://registry.nlark.com/@babel/helper-replace-supers/download/@babel/helper-replace-supers-7.14.5.tgz#0ecc0b03c41cd567b4024ea016134c28414abb94",
|
|
||||||
"@babel/helper-simple-access@^7.14.5": "https://registry.nlark.com/@babel/helper-simple-access/download/@babel/helper-simple-access-7.14.5.tgz#66ea85cf53ba0b4e588ba77fc813f53abcaa41c4",
|
|
||||||
"@babel/helper-split-export-declaration@^7.14.5": "https://registry.nlark.com/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a",
|
|
||||||
"@babel/helper-validator-identifier@^7.14.5": "https://registry.nlark.com/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8",
|
|
||||||
"@babel/helper-validator-option@^7.14.5": "https://registry.nlark.com/@babel/helper-validator-option/download/@babel/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3",
|
|
||||||
"@babel/helpers@^7.14.6": "https://registry.nlark.com/@babel/helpers/download/@babel/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635",
|
|
||||||
"@babel/highlight@^7.10.4": "https://registry.nlark.com/@babel/highlight/download/@babel/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9",
|
|
||||||
"@babel/highlight@^7.14.5": "https://registry.nlark.com/@babel/highlight/download/@babel/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9",
|
|
||||||
"@babel/parser@^7.1.0": "https://registry.nlark.com/@babel/parser/download/@babel/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595",
|
|
||||||
"@babel/parser@^7.14.5": "https://registry.nlark.com/@babel/parser/download/@babel/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595",
|
|
||||||
"@babel/parser@^7.14.6": "https://registry.nlark.com/@babel/parser/download/@babel/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595",
|
|
||||||
"@babel/parser@^7.14.7": "https://registry.nlark.com/@babel/parser/download/@babel/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595",
|
|
||||||
"@babel/parser@^7.7.2": "https://registry.nlark.com/@babel/parser/download/@babel/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595",
|
|
||||||
"@babel/plugin-syntax-async-generators@^7.8.4": "https://registry.npm.taobao.org/@babel/plugin-syntax-async-generators/download/@babel/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d",
|
|
||||||
"@babel/plugin-syntax-bigint@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-bigint/download/@babel/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea",
|
|
||||||
"@babel/plugin-syntax-class-properties@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-class-properties/download/@babel/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10",
|
|
||||||
"@babel/plugin-syntax-import-meta@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-import-meta/download/@babel/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51",
|
|
||||||
"@babel/plugin-syntax-json-strings@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-json-strings/download/@babel/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a",
|
|
||||||
"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-logical-assignment-operators/download/@babel/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699",
|
|
||||||
"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-nullish-coalescing-operator/download/@babel/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9",
|
|
||||||
"@babel/plugin-syntax-numeric-separator@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-numeric-separator/download/@babel/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97",
|
|
||||||
"@babel/plugin-syntax-object-rest-spread@^7.8.3": "https://registry.nlark.com/@babel/plugin-syntax-object-rest-spread/download/@babel/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871",
|
|
||||||
"@babel/plugin-syntax-optional-catch-binding@^7.8.3": "https://registry.nlark.com/@babel/plugin-syntax-optional-catch-binding/download/@babel/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1",
|
|
||||||
"@babel/plugin-syntax-optional-chaining@^7.8.3": "https://registry.npm.taobao.org/@babel/plugin-syntax-optional-chaining/download/@babel/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a",
|
|
||||||
"@babel/plugin-syntax-top-level-await@^7.8.3": "https://registry.nlark.com/@babel/plugin-syntax-top-level-await/download/@babel/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c",
|
|
||||||
"@babel/plugin-syntax-typescript@^7.7.2": "https://registry.nlark.com/@babel/plugin-syntax-typescript/download/@babel/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716",
|
|
||||||
"@babel/template@^7.14.5": "https://registry.nlark.com/@babel/template/download/@babel/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4",
|
|
||||||
"@babel/template@^7.3.3": "https://registry.nlark.com/@babel/template/download/@babel/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4",
|
|
||||||
"@babel/traverse@^7.1.0": "https://registry.nlark.com/@babel/traverse/download/@babel/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753",
|
|
||||||
"@babel/traverse@^7.14.5": "https://registry.nlark.com/@babel/traverse/download/@babel/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753",
|
|
||||||
"@babel/traverse@^7.7.2": "https://registry.nlark.com/@babel/traverse/download/@babel/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753",
|
|
||||||
"@babel/types@^7.0.0": "https://registry.nlark.com/@babel/types/download/@babel/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff",
|
|
||||||
"@babel/types@^7.14.5": "https://registry.nlark.com/@babel/types/download/@babel/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff",
|
|
||||||
"@babel/types@^7.3.0": "https://registry.nlark.com/@babel/types/download/@babel/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff",
|
|
||||||
"@babel/types@^7.3.3": "https://registry.nlark.com/@babel/types/download/@babel/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff",
|
|
||||||
"@bcoe/v8-coverage@^0.2.3": "https://registry.nlark.com/@bcoe/v8-coverage/download/@bcoe/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39",
|
|
||||||
"@eslint/eslintrc@^0.4.2": "https://registry.nlark.com/@eslint/eslintrc/download/@eslint/eslintrc-0.4.2.tgz#f63d0ef06f5c0c57d76c4ab5f63d3835c51b0179",
|
|
||||||
"@humanwhocodes/config-array@^0.5.0": "https://registry.nlark.com/@humanwhocodes/config-array/download/@humanwhocodes/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9",
|
|
||||||
"@humanwhocodes/object-schema@^1.2.0": "https://registry.nlark.com/@humanwhocodes/object-schema/download/@humanwhocodes/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf",
|
|
||||||
"@istanbuljs/load-nyc-config@^1.0.0": "https://registry.npm.taobao.org/@istanbuljs/load-nyc-config/download/@istanbuljs/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced",
|
|
||||||
"@istanbuljs/schema@^0.1.2": "https://registry.npm.taobao.org/@istanbuljs/schema/download/@istanbuljs/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98",
|
|
||||||
"@jest/console@^27.0.6": "https://registry.nlark.com/@jest/console/download/@jest/console-27.0.6.tgz#3eb72ea80897495c3d73dd97aab7f26770e2260f",
|
|
||||||
"@jest/core@^27.0.6": "https://registry.nlark.com/@jest/core/download/@jest/core-27.0.6.tgz#c5f642727a0b3bf0f37c4b46c675372d0978d4a1",
|
|
||||||
"@jest/environment@^27.0.6": "https://registry.nlark.com/@jest/environment/download/@jest/environment-27.0.6.tgz#ee293fe996db01d7d663b8108fa0e1ff436219d2",
|
|
||||||
"@jest/fake-timers@^27.0.6": "https://registry.nlark.com/@jest/fake-timers/download/@jest/fake-timers-27.0.6.tgz#cbad52f3fe6abe30e7acb8cd5fa3466b9588e3df",
|
|
||||||
"@jest/globals@^27.0.6": "https://registry.nlark.com/@jest/globals/download/@jest/globals-27.0.6.tgz#48e3903f99a4650673d8657334d13c9caf0e8f82",
|
|
||||||
"@jest/reporters@^27.0.6": "https://registry.nlark.com/@jest/reporters/download/@jest/reporters-27.0.6.tgz#91e7f2d98c002ad5df94d5b5167c1eb0b9fd5b00",
|
|
||||||
"@jest/source-map@^27.0.6": "https://registry.nlark.com/@jest/source-map/download/@jest/source-map-27.0.6.tgz#be9e9b93565d49b0548b86e232092491fb60551f",
|
|
||||||
"@jest/test-result@^27.0.6": "https://registry.nlark.com/@jest/test-result/download/@jest/test-result-27.0.6.tgz#3fa42015a14e4fdede6acd042ce98c7f36627051",
|
|
||||||
"@jest/test-sequencer@^27.0.6": "https://registry.nlark.com/@jest/test-sequencer/download/@jest/test-sequencer-27.0.6.tgz#80a913ed7a1130545b1cd777ff2735dd3af5d34b",
|
|
||||||
"@jest/transform@^27.0.6": "https://registry.nlark.com/@jest/transform/download/@jest/transform-27.0.6.tgz#189ad7107413208f7600f4719f81dd2f7278cc95",
|
|
||||||
"@jest/types@^26.6.2": "https://registry.nlark.com/@jest/types/download/@jest/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e",
|
|
||||||
"@jest/types@^27.0.6": "https://registry.nlark.com/@jest/types/download/@jest/types-27.0.6.tgz#9a992bc517e0c49f035938b8549719c2de40706b",
|
|
||||||
"@nodelib/fs.scandir@2.1.5": "https://registry.nlark.com/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5",
|
|
||||||
"@nodelib/fs.stat@2.0.5": "https://registry.nlark.com/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b",
|
|
||||||
"@nodelib/fs.stat@^2.0.2": "https://registry.nlark.com/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b",
|
|
||||||
"@nodelib/fs.walk@^1.2.3": "https://registry.nlark.com/@nodelib/fs.walk/download/@nodelib/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a",
|
|
||||||
"@sinonjs/commons@^1.7.0": "https://registry.nlark.com/@sinonjs/commons/download/@sinonjs/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d",
|
|
||||||
"@sinonjs/fake-timers@^7.0.2": "https://registry.nlark.com/@sinonjs/fake-timers/download/@sinonjs/fake-timers-7.1.2.tgz#2524eae70c4910edccf99b2f4e6efc5894aff7b5",
|
|
||||||
"@tootallnate/once@1": "https://registry.npm.taobao.org/@tootallnate/once/download/@tootallnate/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82",
|
|
||||||
"@types/babel__core@^7.0.0": "https://registry.nlark.com/@types/babel__core/download/@types/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024",
|
|
||||||
"@types/babel__core@^7.1.14": "https://registry.nlark.com/@types/babel__core/download/@types/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024",
|
|
||||||
"@types/babel__generator@*": "https://registry.nlark.com/@types/babel__generator/download/@types/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5",
|
|
||||||
"@types/babel__template@*": "https://registry.nlark.com/@types/babel__template/download/@types/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969",
|
|
||||||
"@types/babel__traverse@*": "https://registry.nlark.com/@types/babel__traverse/download/@types/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43",
|
|
||||||
"@types/babel__traverse@^7.0.4": "https://registry.nlark.com/@types/babel__traverse/download/@types/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43",
|
|
||||||
"@types/babel__traverse@^7.0.6": "https://registry.nlark.com/@types/babel__traverse/download/@types/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43",
|
|
||||||
"@types/graceful-fs@^4.1.2": "https://registry.nlark.com/@types/graceful-fs/download/@types/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15",
|
|
||||||
"@types/istanbul-lib-coverage@*": "https://registry.nlark.com/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762",
|
|
||||||
"@types/istanbul-lib-coverage@^2.0.0": "https://registry.nlark.com/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762",
|
|
||||||
"@types/istanbul-lib-coverage@^2.0.1": "https://registry.nlark.com/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762",
|
|
||||||
"@types/istanbul-lib-report@*": "https://registry.nlark.com/@types/istanbul-lib-report/download/@types/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686",
|
|
||||||
"@types/istanbul-reports@^3.0.0": "https://registry.nlark.com/@types/istanbul-reports/download/@types/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff",
|
|
||||||
"@types/jest@^26.0.24": "https://registry.nlark.com/@types/jest/download/@types/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a",
|
|
||||||
"@types/json-schema@^7.0.7": "https://registry.nlark.com/@types/json-schema/download/@types/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818",
|
|
||||||
"@types/node@*": "https://registry.nlark.com/@types/node/download/@types/node-16.3.2.tgz#655432817f83b51ac869c2d51dd8305fb8342e16",
|
|
||||||
"@types/node@^16.3.2": "https://registry.nlark.com/@types/node/download/@types/node-16.3.2.tgz#655432817f83b51ac869c2d51dd8305fb8342e16",
|
|
||||||
"@types/prettier@^2.1.5": "https://registry.nlark.com/@types/prettier/download/@types/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3",
|
|
||||||
"@types/semver@^7.3.7": "https://registry.nlark.com/@types/semver/download/@types/semver-7.3.7.tgz#b9eb89d7dfa70d5d1ce525bc1411a35347f533a3",
|
|
||||||
"@types/stack-utils@^2.0.0": "https://registry.nlark.com/@types/stack-utils/download/@types/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c",
|
|
||||||
"@types/yargs-parser@*": "https://registry.nlark.com/@types/yargs-parser/download/@types/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129",
|
|
||||||
"@types/yargs@^15.0.0": "https://registry.nlark.com/@types/yargs/download/@types/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06",
|
|
||||||
"@types/yargs@^16.0.0": "https://registry.nlark.com/@types/yargs/download/@types/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977",
|
|
||||||
"@typescript-eslint/eslint-plugin@^4.28.3": "https://registry.nlark.com/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-4.28.3.tgz#36cdcd9ca6f9e5cb49b9f61b970b1976708d084b",
|
|
||||||
"@typescript-eslint/experimental-utils@4.28.3": "https://registry.nlark.com/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-4.28.3.tgz#976f8c1191b37105fd06658ed57ddfee4be361ca",
|
|
||||||
"@typescript-eslint/parser@^4.28.3": "https://registry.nlark.com/@typescript-eslint/parser/download/@typescript-eslint/parser-4.28.3.tgz#95f1d475c08268edffdcb2779993c488b6434b44",
|
|
||||||
"@typescript-eslint/scope-manager@4.28.3": "https://registry.nlark.com/@typescript-eslint/scope-manager/download/@typescript-eslint/scope-manager-4.28.3.tgz#c32ad4491b3726db1ba34030b59ea922c214e371",
|
|
||||||
"@typescript-eslint/types@4.28.3": "https://registry.nlark.com/@typescript-eslint/types/download/@typescript-eslint/types-4.28.3.tgz#8fffd436a3bada422c2c1da56060a0566a9506c7",
|
|
||||||
"@typescript-eslint/typescript-estree@4.28.3": "https://registry.nlark.com/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-4.28.3.tgz#253d7088100b2a38aefe3c8dd7bd1f8232ec46fb",
|
|
||||||
"@typescript-eslint/visitor-keys@4.28.3": "https://registry.nlark.com/@typescript-eslint/visitor-keys/download/@typescript-eslint/visitor-keys-4.28.3.tgz#26ac91e84b23529968361045829da80a4e5251c4",
|
|
||||||
"abab@^2.0.3": "https://registry.npm.taobao.org/abab/download/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a",
|
|
||||||
"abab@^2.0.5": "https://registry.npm.taobao.org/abab/download/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a",
|
|
||||||
"acorn-globals@^6.0.0": "https://registry.npm.taobao.org/acorn-globals/download/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45",
|
|
||||||
"acorn-jsx@^5.3.1": "https://registry.nlark.com/acorn-jsx/download/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937",
|
|
||||||
"acorn-walk@^7.1.1": "https://registry.nlark.com/acorn-walk/download/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc",
|
|
||||||
"acorn@^7.1.1": "https://registry.nlark.com/acorn/download/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa",
|
|
||||||
"acorn@^7.4.0": "https://registry.nlark.com/acorn/download/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa",
|
|
||||||
"acorn@^8.2.4": "https://registry.nlark.com/acorn/download/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c",
|
|
||||||
"agent-base@6": "https://registry.npm.taobao.org/agent-base/download/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77",
|
|
||||||
"ajv@^6.10.0": "https://registry.nlark.com/ajv/download/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4",
|
|
||||||
"ajv@^6.12.4": "https://registry.nlark.com/ajv/download/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4",
|
|
||||||
"ajv@^8.0.1": "https://registry.nlark.com/ajv/download/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571",
|
|
||||||
"ansi-colors@^4.1.1": "https://registry.npm.taobao.org/ansi-colors/download/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348",
|
|
||||||
"ansi-escapes@^4.2.1": "https://registry.npm.taobao.org/ansi-escapes/download/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e",
|
|
||||||
"ansi-regex@^5.0.0": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304",
|
|
||||||
"ansi-styles@^3.2.1": "https://registry.nlark.com/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d",
|
|
||||||
"ansi-styles@^4.0.0": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937",
|
|
||||||
"ansi-styles@^4.1.0": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937",
|
|
||||||
"ansi-styles@^5.0.0": "https://registry.nlark.com/ansi-styles/download/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b",
|
|
||||||
"anymatch@^3.0.3": "https://registry.nlark.com/anymatch/download/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716",
|
|
||||||
"argparse@^1.0.7": "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911",
|
|
||||||
"array-union@^2.1.0": "https://registry.npm.taobao.org/array-union/download/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d",
|
|
||||||
"astral-regex@^2.0.0": "https://registry.npm.taobao.org/astral-regex/download/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31",
|
|
||||||
"asynckit@^0.4.0": "https://registry.nlark.com/asynckit/download/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79",
|
|
||||||
"babel-jest@^27.0.6": "https://registry.nlark.com/babel-jest/download/babel-jest-27.0.6.tgz#e99c6e0577da2655118e3608b68761a5a69bd0d8",
|
|
||||||
"babel-plugin-istanbul@^6.0.0": "https://registry.npm.taobao.org/babel-plugin-istanbul/download/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765",
|
|
||||||
"babel-plugin-jest-hoist@^27.0.6": "https://registry.nlark.com/babel-plugin-jest-hoist/download/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456",
|
|
||||||
"babel-preset-current-node-syntax@^1.0.0": "https://registry.npm.taobao.org/babel-preset-current-node-syntax/download/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b",
|
|
||||||
"babel-preset-jest@^27.0.6": "https://registry.nlark.com/babel-preset-jest/download/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d",
|
|
||||||
"balanced-match@^1.0.0": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee",
|
|
||||||
"brace-expansion@^1.1.7": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
|
||||||
"braces@^3.0.1": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107",
|
|
||||||
"browser-process-hrtime@^1.0.0": "https://registry.npm.taobao.org/browser-process-hrtime/download/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626",
|
|
||||||
"browserslist@^4.16.6": "https://registry.nlark.com/browserslist/download/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2",
|
|
||||||
"bs-logger@0.x": "https://registry.npm.taobao.org/bs-logger/download/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8",
|
|
||||||
"bser@2.1.1": "https://registry.npm.taobao.org/bser/download/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05",
|
|
||||||
"buffer-from@1.x": "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
|
|
||||||
"buffer-from@^1.0.0": "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
|
|
||||||
"callsites@^3.0.0": "https://registry.npm.taobao.org/callsites/download/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73",
|
|
||||||
"camelcase@^5.3.1": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320",
|
|
||||||
"camelcase@^6.2.0": "https://registry.npm.taobao.org/camelcase/download/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809",
|
|
||||||
"caniuse-lite@^1.0.30001219": "https://registry.nlark.com/caniuse-lite/download/caniuse-lite-1.0.30001245.tgz#45b941bbd833cb0fa53861ff2bae746b3c6ca5d4",
|
|
||||||
"chalk@^2.0.0": "https://registry.nlark.com/chalk/download/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424",
|
|
||||||
"chalk@^4.0.0": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad",
|
|
||||||
"char-regex@^1.0.2": "https://registry.nlark.com/char-regex/download/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf",
|
|
||||||
"ci-info@^3.1.1": "https://registry.nlark.com/ci-info/download/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6",
|
|
||||||
"cjs-module-lexer@^1.0.0": "https://registry.nlark.com/cjs-module-lexer/download/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40",
|
|
||||||
"cliui@^7.0.2": "https://registry.npm.taobao.org/cliui/download/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f",
|
|
||||||
"co@^4.6.0": "https://registry.npm.taobao.org/co/download/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184",
|
|
||||||
"collect-v8-coverage@^1.0.0": "https://registry.npm.taobao.org/collect-v8-coverage/download/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59",
|
|
||||||
"color-convert@^1.9.0": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8",
|
|
||||||
"color-convert@^2.0.1": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3",
|
|
||||||
"color-name@1.1.3": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25",
|
|
||||||
"color-name@~1.1.4": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2",
|
|
||||||
"colorette@^1.2.2": "https://registry.npm.taobao.org/colorette/download/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94",
|
|
||||||
"combined-stream@^1.0.8": "https://registry.nlark.com/combined-stream/download/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f",
|
|
||||||
"concat-map@0.0.1": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
|
||||||
"convert-source-map@^1.4.0": "https://registry.nlark.com/convert-source-map/download/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369",
|
|
||||||
"convert-source-map@^1.6.0": "https://registry.nlark.com/convert-source-map/download/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369",
|
|
||||||
"convert-source-map@^1.7.0": "https://registry.nlark.com/convert-source-map/download/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369",
|
|
||||||
"cross-spawn@^7.0.2": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6",
|
|
||||||
"cross-spawn@^7.0.3": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6",
|
|
||||||
"cssom@^0.4.4": "https://registry.nlark.com/cssom/download/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10",
|
|
||||||
"cssom@~0.3.6": "https://registry.nlark.com/cssom/download/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a",
|
|
||||||
"cssstyle@^2.3.0": "https://registry.nlark.com/cssstyle/download/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852",
|
|
||||||
"data-urls@^2.0.0": "https://registry.nlark.com/data-urls/download/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b",
|
|
||||||
"debug@4": "https://registry.nlark.com/debug/download/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b",
|
|
||||||
"debug@^4.0.1": "https://registry.nlark.com/debug/download/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b",
|
|
||||||
"debug@^4.1.0": "https://registry.nlark.com/debug/download/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b",
|
|
||||||
"debug@^4.1.1": "https://registry.nlark.com/debug/download/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b",
|
|
||||||
"debug@^4.3.1": "https://registry.nlark.com/debug/download/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b",
|
|
||||||
"decimal.js@^10.2.1": "https://registry.nlark.com/decimal.js/download/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783",
|
|
||||||
"dedent@^0.7.0": "https://registry.nlark.com/dedent/download/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c",
|
|
||||||
"deep-is@^0.1.3": "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34",
|
|
||||||
"deep-is@~0.1.3": "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34",
|
|
||||||
"deepmerge@^4.2.2": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955",
|
|
||||||
"delayed-stream@~1.0.0": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619",
|
|
||||||
"detect-newline@^3.0.0": "https://registry.npm.taobao.org/detect-newline/download/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651",
|
|
||||||
"diff-sequences@^26.6.2": "https://registry.nlark.com/diff-sequences/download/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1",
|
|
||||||
"diff-sequences@^27.0.6": "https://registry.nlark.com/diff-sequences/download/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723",
|
|
||||||
"dir-glob@^3.0.1": "https://registry.npm.taobao.org/dir-glob/download/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f",
|
|
||||||
"doctrine@^3.0.0": "https://registry.npm.taobao.org/doctrine/download/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961",
|
|
||||||
"domexception@^2.0.1": "https://registry.npm.taobao.org/domexception/download/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304",
|
|
||||||
"electron-to-chromium@^1.3.723": "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.778.tgz#bf01048736c95b78f2988e88005e0ebb385942a4",
|
|
||||||
"emittery@^0.8.1": "https://registry.nlark.com/emittery/download/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860",
|
|
||||||
"emoji-regex@^8.0.0": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37",
|
|
||||||
"enquirer@^2.3.5": "https://registry.npm.taobao.org/enquirer/download/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d",
|
|
||||||
"escalade@^3.1.1": "https://registry.npm.taobao.org/escalade/download/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40",
|
|
||||||
"escape-string-regexp@^1.0.5": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
|
|
||||||
"escape-string-regexp@^2.0.0": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344",
|
|
||||||
"escape-string-regexp@^4.0.0": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34",
|
|
||||||
"escodegen@^2.0.0": "https://registry.npm.taobao.org/escodegen/download/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd",
|
|
||||||
"eslint-config-prettier@^8.3.0": "https://registry.nlark.com/eslint-config-prettier/download/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a",
|
|
||||||
"eslint-plugin-prettier@^3.4.0": "https://registry.npm.taobao.org/eslint-plugin-prettier/download/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7",
|
|
||||||
"eslint-scope@^5.1.1": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c",
|
|
||||||
"eslint-utils@^2.1.0": "https://registry.nlark.com/eslint-utils/download/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27",
|
|
||||||
"eslint-utils@^3.0.0": "https://registry.nlark.com/eslint-utils/download/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672",
|
|
||||||
"eslint-visitor-keys@^1.1.0": "https://registry.nlark.com/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e",
|
|
||||||
"eslint-visitor-keys@^1.3.0": "https://registry.nlark.com/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e",
|
|
||||||
"eslint-visitor-keys@^2.0.0": "https://registry.nlark.com/eslint-visitor-keys/download/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303",
|
|
||||||
"eslint@^7.30.0": "https://registry.nlark.com/eslint/download/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8",
|
|
||||||
"espree@^7.3.0": "https://registry.nlark.com/espree/download/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6",
|
|
||||||
"espree@^7.3.1": "https://registry.nlark.com/espree/download/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6",
|
|
||||||
"esprima@^4.0.0": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71",
|
|
||||||
"esprima@^4.0.1": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71",
|
|
||||||
"esquery@^1.4.0": "https://registry.npm.taobao.org/esquery/download/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5",
|
|
||||||
"esrecurse@^4.3.0": "https://registry.npm.taobao.org/esrecurse/download/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921",
|
|
||||||
"estraverse@^4.1.1": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d",
|
|
||||||
"estraverse@^5.1.0": "https://registry.npm.taobao.org/estraverse/download/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880",
|
|
||||||
"estraverse@^5.2.0": "https://registry.npm.taobao.org/estraverse/download/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880",
|
|
||||||
"esutils@^2.0.2": "https://registry.nlark.com/esutils/download/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64",
|
|
||||||
"execa@^5.0.0": "https://registry.nlark.com/execa/download/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd",
|
|
||||||
"exit@^0.1.2": "https://registry.npm.taobao.org/exit/download/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c",
|
|
||||||
"expect@^27.0.6": "https://registry.nlark.com/expect/download/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05",
|
|
||||||
"fast-deep-equal@^3.1.1": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525",
|
|
||||||
"fast-deep-equal@^3.1.3": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525",
|
|
||||||
"fast-diff@^1.1.2": "https://registry.nlark.com/fast-diff/download/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03",
|
|
||||||
"fast-glob@^3.1.1": "https://registry.nlark.com/fast-glob/download/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1",
|
|
||||||
"fast-json-stable-stringify@2.x": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633",
|
|
||||||
"fast-json-stable-stringify@^2.0.0": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633",
|
|
||||||
"fast-levenshtein@^2.0.6": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917",
|
|
||||||
"fast-levenshtein@~2.0.6": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917",
|
|
||||||
"fastq@^1.6.0": "https://registry.nlark.com/fastq/download/fastq-1.11.1.tgz#5d8175aae17db61947f8b162cfc7f63264d22807",
|
|
||||||
"fb-watchman@^2.0.0": "https://registry.npm.taobao.org/fb-watchman/download/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85",
|
|
||||||
"file-entry-cache@^6.0.1": "https://registry.nlark.com/file-entry-cache/download/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027",
|
|
||||||
"fill-range@^7.0.1": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40",
|
|
||||||
"find-up@^4.0.0": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19",
|
|
||||||
"find-up@^4.1.0": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19",
|
|
||||||
"flat-cache@^3.0.4": "https://registry.npm.taobao.org/flat-cache/download/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11",
|
|
||||||
"flatted@^3.1.0": "https://registry.nlark.com/flatted/download/flatted-3.2.1.tgz#bbef080d95fca6709362c73044a1634f7c6e7d05",
|
|
||||||
"form-data@^3.0.0": "https://registry.npm.taobao.org/form-data/download/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f",
|
|
||||||
"fs.realpath@^1.0.0": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f",
|
|
||||||
"fsevents@^2.3.2": "https://registry.npm.taobao.org/fsevents/download/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a",
|
|
||||||
"function-bind@^1.1.1": "https://registry.nlark.com/function-bind/download/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d",
|
|
||||||
"functional-red-black-tree@^1.0.1": "https://registry.npm.taobao.org/functional-red-black-tree/download/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327",
|
|
||||||
"gensync@^1.0.0-beta.2": "https://registry.npm.taobao.org/gensync/download/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0",
|
|
||||||
"get-caller-file@^2.0.5": "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e",
|
|
||||||
"get-package-type@^0.1.0": "https://registry.npm.taobao.org/get-package-type/download/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a",
|
|
||||||
"get-stream@^6.0.0": "https://registry.npm.taobao.org/get-stream/download/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7",
|
|
||||||
"glob-parent@^5.1.2": "https://registry.nlark.com/glob-parent/download/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4",
|
|
||||||
"glob@^7.1.1": "https://registry.nlark.com/glob/download/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
|
|
||||||
"glob@^7.1.2": "https://registry.nlark.com/glob/download/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
|
|
||||||
"glob@^7.1.3": "https://registry.nlark.com/glob/download/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
|
|
||||||
"glob@^7.1.4": "https://registry.nlark.com/glob/download/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
|
|
||||||
"globals@^11.1.0": "https://registry.nlark.com/globals/download/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e",
|
|
||||||
"globals@^13.6.0": "https://registry.nlark.com/globals/download/globals-13.10.0.tgz#60ba56c3ac2ca845cfbf4faeca727ad9dd204676",
|
|
||||||
"globals@^13.9.0": "https://registry.nlark.com/globals/download/globals-13.10.0.tgz#60ba56c3ac2ca845cfbf4faeca727ad9dd204676",
|
|
||||||
"globby@^11.0.3": "https://registry.nlark.com/globby/download/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5",
|
|
||||||
"graceful-fs@^4.2.4": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee",
|
|
||||||
"has-flag@^3.0.0": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd",
|
|
||||||
"has-flag@^4.0.0": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b",
|
|
||||||
"has@^1.0.3": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796",
|
|
||||||
"html-encoding-sniffer@^2.0.1": "https://registry.npm.taobao.org/html-encoding-sniffer/download/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3",
|
|
||||||
"html-escaper@^2.0.0": "https://registry.npm.taobao.org/html-escaper/download/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453",
|
|
||||||
"http-proxy-agent@^4.0.1": "https://registry.npm.taobao.org/http-proxy-agent/download/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a",
|
|
||||||
"https-proxy-agent@^5.0.0": "https://registry.nlark.com/https-proxy-agent/download/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2",
|
|
||||||
"human-signals@^2.1.0": "https://registry.nlark.com/human-signals/download/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0",
|
|
||||||
"iconv-lite@0.4.24": "https://registry.nlark.com/iconv-lite/download/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b",
|
|
||||||
"ignore@^4.0.6": "https://registry.npm.taobao.org/ignore/download/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc",
|
|
||||||
"ignore@^5.1.4": "https://registry.npm.taobao.org/ignore/download/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57",
|
|
||||||
"import-fresh@^3.0.0": "https://registry.nlark.com/import-fresh/download/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b",
|
|
||||||
"import-fresh@^3.2.1": "https://registry.nlark.com/import-fresh/download/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b",
|
|
||||||
"import-local@^3.0.2": "https://registry.npm.taobao.org/import-local/download/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6",
|
|
||||||
"imurmurhash@^0.1.4": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea",
|
|
||||||
"inflight@^1.0.4": "https://registry.nlark.com/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9",
|
|
||||||
"inherits@2": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
|
||||||
"is-ci@^3.0.0": "https://registry.npm.taobao.org/is-ci/download/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994",
|
|
||||||
"is-core-module@^2.2.0": "https://registry.nlark.com/is-core-module/download/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491",
|
|
||||||
"is-extglob@^2.1.1": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2",
|
|
||||||
"is-fullwidth-code-point@^3.0.0": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d",
|
|
||||||
"is-generator-fn@^2.0.0": "https://registry.npm.taobao.org/is-generator-fn/download/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118",
|
|
||||||
"is-glob@^4.0.0": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
|
|
||||||
"is-glob@^4.0.1": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
|
|
||||||
"is-number@^7.0.0": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b",
|
|
||||||
"is-potential-custom-element-name@^1.0.1": "https://registry.npm.taobao.org/is-potential-custom-element-name/download/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5",
|
|
||||||
"is-stream@^2.0.0": "https://registry.npm.taobao.org/is-stream/download/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3",
|
|
||||||
"is-typedarray@^1.0.0": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a",
|
|
||||||
"isexe@^2.0.0": "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10",
|
|
||||||
"istanbul-lib-coverage@^3.0.0": "https://registry.npm.taobao.org/istanbul-lib-coverage/download/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec",
|
|
||||||
"istanbul-lib-instrument@^4.0.0": "https://registry.npm.taobao.org/istanbul-lib-instrument/download/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d",
|
|
||||||
"istanbul-lib-instrument@^4.0.3": "https://registry.npm.taobao.org/istanbul-lib-instrument/download/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d",
|
|
||||||
"istanbul-lib-report@^3.0.0": "https://registry.nlark.com/istanbul-lib-report/download/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6",
|
|
||||||
"istanbul-lib-source-maps@^4.0.0": "https://registry.npm.taobao.org/istanbul-lib-source-maps/download/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9",
|
|
||||||
"istanbul-reports@^3.0.2": "https://registry.nlark.com/istanbul-reports/download/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b",
|
|
||||||
"jest-changed-files@^27.0.6": "https://registry.nlark.com/jest-changed-files/download/jest-changed-files-27.0.6.tgz#bed6183fcdea8a285482e3b50a9a7712d49a7a8b",
|
|
||||||
"jest-circus@^27.0.6": "https://registry.nlark.com/jest-circus/download/jest-circus-27.0.6.tgz#dd4df17c4697db6a2c232aaad4e9cec666926668",
|
|
||||||
"jest-cli@^27.0.6": "https://registry.nlark.com/jest-cli/download/jest-cli-27.0.6.tgz#d021e5f4d86d6a212450d4c7b86cb219f1e6864f",
|
|
||||||
"jest-config@^27.0.6": "https://registry.nlark.com/jest-config/download/jest-config-27.0.6.tgz#119fb10f149ba63d9c50621baa4f1f179500277f",
|
|
||||||
"jest-diff@^26.0.0": "https://registry.nlark.com/jest-diff/download/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394",
|
|
||||||
"jest-diff@^27.0.6": "https://registry.nlark.com/jest-diff/download/jest-diff-27.0.6.tgz#4a7a19ee6f04ad70e0e3388f35829394a44c7b5e",
|
|
||||||
"jest-docblock@^27.0.6": "https://registry.nlark.com/jest-docblock/download/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3",
|
|
||||||
"jest-each@^27.0.6": "https://registry.nlark.com/jest-each/download/jest-each-27.0.6.tgz#cee117071b04060158dc8d9a66dc50ad40ef453b",
|
|
||||||
"jest-environment-jsdom@^27.0.6": "https://registry.nlark.com/jest-environment-jsdom/download/jest-environment-jsdom-27.0.6.tgz#f66426c4c9950807d0a9f209c590ce544f73291f",
|
|
||||||
"jest-environment-node@^27.0.6": "https://registry.nlark.com/jest-environment-node/download/jest-environment-node-27.0.6.tgz#a6699b7ceb52e8d68138b9808b0c404e505f3e07",
|
|
||||||
"jest-get-type@^26.3.0": "https://registry.nlark.com/jest-get-type/download/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0",
|
|
||||||
"jest-get-type@^27.0.6": "https://registry.nlark.com/jest-get-type/download/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe",
|
|
||||||
"jest-haste-map@^27.0.6": "https://registry.nlark.com/jest-haste-map/download/jest-haste-map-27.0.6.tgz#4683a4e68f6ecaa74231679dca237279562c8dc7",
|
|
||||||
"jest-jasmine2@^27.0.6": "https://registry.nlark.com/jest-jasmine2/download/jest-jasmine2-27.0.6.tgz#fd509a9ed3d92bd6edb68a779f4738b100655b37",
|
|
||||||
"jest-leak-detector@^27.0.6": "https://registry.nlark.com/jest-leak-detector/download/jest-leak-detector-27.0.6.tgz#545854275f85450d4ef4b8fe305ca2a26450450f",
|
|
||||||
"jest-matcher-utils@^27.0.6": "https://registry.nlark.com/jest-matcher-utils/download/jest-matcher-utils-27.0.6.tgz#2a8da1e86c620b39459f4352eaa255f0d43e39a9",
|
|
||||||
"jest-message-util@^27.0.6": "https://registry.nlark.com/jest-message-util/download/jest-message-util-27.0.6.tgz#158bcdf4785706492d164a39abca6a14da5ab8b5",
|
|
||||||
"jest-mock@^27.0.6": "https://registry.nlark.com/jest-mock/download/jest-mock-27.0.6.tgz#0efdd40851398307ba16778728f6d34d583e3467",
|
|
||||||
"jest-pnp-resolver@^1.2.2": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c",
|
|
||||||
"jest-regex-util@^27.0.6": "https://registry.nlark.com/jest-regex-util/download/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5",
|
|
||||||
"jest-resolve-dependencies@^27.0.6": "https://registry.nlark.com/jest-resolve-dependencies/download/jest-resolve-dependencies-27.0.6.tgz#3e619e0ef391c3ecfcf6ef4056207a3d2be3269f",
|
|
||||||
"jest-resolve@^27.0.6": "https://registry.nlark.com/jest-resolve/download/jest-resolve-27.0.6.tgz#e90f436dd4f8fbf53f58a91c42344864f8e55bff",
|
|
||||||
"jest-runner@^27.0.6": "https://registry.nlark.com/jest-runner/download/jest-runner-27.0.6.tgz#1325f45055539222bbc7256a6976e993ad2f9520",
|
|
||||||
"jest-runtime@^27.0.6": "https://registry.nlark.com/jest-runtime/download/jest-runtime-27.0.6.tgz#45877cfcd386afdd4f317def551fc369794c27c9",
|
|
||||||
"jest-serializer@^27.0.6": "https://registry.nlark.com/jest-serializer/download/jest-serializer-27.0.6.tgz#93a6c74e0132b81a2d54623251c46c498bb5bec1",
|
|
||||||
"jest-snapshot@^27.0.6": "https://registry.nlark.com/jest-snapshot/download/jest-snapshot-27.0.6.tgz#f4e6b208bd2e92e888344d78f0f650bcff05a4bf",
|
|
||||||
"jest-util@^27.0.0": "https://registry.nlark.com/jest-util/download/jest-util-27.0.6.tgz#e8e04eec159de2f4d5f57f795df9cdc091e50297",
|
|
||||||
"jest-util@^27.0.6": "https://registry.nlark.com/jest-util/download/jest-util-27.0.6.tgz#e8e04eec159de2f4d5f57f795df9cdc091e50297",
|
|
||||||
"jest-validate@^27.0.6": "https://registry.nlark.com/jest-validate/download/jest-validate-27.0.6.tgz#930a527c7a951927df269f43b2dc23262457e2a6",
|
|
||||||
"jest-watcher@^27.0.6": "https://registry.nlark.com/jest-watcher/download/jest-watcher-27.0.6.tgz#89526f7f9edf1eac4e4be989bcb6dec6b8878d9c",
|
|
||||||
"jest-worker@^27.0.6": "https://registry.nlark.com/jest-worker/download/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed",
|
|
||||||
"jest@^27.0.6": "https://registry.nlark.com/jest/download/jest-27.0.6.tgz#10517b2a628f0409087fbf473db44777d7a04505",
|
|
||||||
"js-tokens@^4.0.0": "https://registry.nlark.com/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499",
|
|
||||||
"js-yaml@^3.13.1": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537",
|
|
||||||
"jsdom@^16.6.0": "https://registry.nlark.com/jsdom/download/jsdom-16.6.0.tgz#f79b3786682065492a3da6a60a4695da983805ac",
|
|
||||||
"jsesc@^2.5.1": "https://registry.nlark.com/jsesc/download/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4",
|
|
||||||
"json-schema-traverse@^0.4.1": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660",
|
|
||||||
"json-schema-traverse@^1.0.0": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2",
|
|
||||||
"json-stable-stringify-without-jsonify@^1.0.1": "https://registry.npm.taobao.org/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651",
|
|
||||||
"json5@2.x": "https://registry.npm.taobao.org/json5/download/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3",
|
|
||||||
"json5@^2.1.2": "https://registry.npm.taobao.org/json5/download/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3",
|
|
||||||
"kleur@^3.0.3": "https://registry.nlark.com/kleur/download/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e",
|
|
||||||
"leven@^3.1.0": "https://registry.npm.taobao.org/leven/download/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2",
|
|
||||||
"levn@^0.4.1": "https://registry.nlark.com/levn/download/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade",
|
|
||||||
"levn@~0.3.0": "https://registry.nlark.com/levn/download/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee",
|
|
||||||
"locate-path@^5.0.0": "https://registry.nlark.com/locate-path/download/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0",
|
|
||||||
"lodash.clonedeep@^4.5.0": "https://registry.nlark.com/lodash.clonedeep/download/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef",
|
|
||||||
"lodash.merge@^4.6.2": "https://registry.npm.taobao.org/lodash.merge/download/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a",
|
|
||||||
"lodash.truncate@^4.4.2": "https://registry.nlark.com/lodash.truncate/download/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193",
|
|
||||||
"lodash@4.x": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c",
|
|
||||||
"lodash@^4.7.0": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c",
|
|
||||||
"lru-cache@^6.0.0": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94",
|
|
||||||
"make-dir@^3.0.0": "https://registry.nlark.com/make-dir/download/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f",
|
|
||||||
"make-error@1.x": "https://registry.npm.taobao.org/make-error/download/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2",
|
|
||||||
"makeerror@1.0.x": "https://registry.npm.taobao.org/makeerror/download/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c",
|
|
||||||
"merge-stream@^2.0.0": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60",
|
|
||||||
"merge2@^1.3.0": "https://registry.npm.taobao.org/merge2/download/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae",
|
|
||||||
"micromatch@^4.0.4": "https://registry.nlark.com/micromatch/download/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9",
|
|
||||||
"mime-db@1.48.0": "https://registry.nlark.com/mime-db/download/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d",
|
|
||||||
"mime-types@^2.1.12": "https://registry.nlark.com/mime-types/download/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b",
|
|
||||||
"mimic-fn@^2.1.0": "https://registry.nlark.com/mimic-fn/download/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b",
|
|
||||||
"minimatch@^3.0.4": "https://registry.nlark.com/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083",
|
|
||||||
"minimist@^1.2.5": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44",
|
|
||||||
"mkdirp@1.x": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e",
|
|
||||||
"ms@2.1.2": "https://registry.nlark.com/ms/download/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009",
|
|
||||||
"natural-compare@^1.4.0": "https://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7",
|
|
||||||
"node-int64@^0.4.0": "https://registry.npm.taobao.org/node-int64/download/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b",
|
|
||||||
"node-modules-regexp@^1.0.0": "https://registry.npm.taobao.org/node-modules-regexp/download/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40",
|
|
||||||
"node-releases@^1.1.71": "https://registry.nlark.com/node-releases/download/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20",
|
|
||||||
"normalize-path@^3.0.0": "https://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65",
|
|
||||||
"npm-run-path@^4.0.1": "https://registry.nlark.com/npm-run-path/download/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea",
|
|
||||||
"nwsapi@^2.2.0": "https://registry.npm.taobao.org/nwsapi/download/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7",
|
|
||||||
"once@^1.3.0": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
|
||||||
"onetime@^5.1.2": "https://registry.npm.taobao.org/onetime/download/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e",
|
|
||||||
"optionator@^0.8.1": "https://registry.npm.taobao.org/optionator/download/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495",
|
|
||||||
"optionator@^0.9.1": "https://registry.npm.taobao.org/optionator/download/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499",
|
|
||||||
"p-each-series@^2.1.0": "https://registry.npm.taobao.org/p-each-series/download/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a",
|
|
||||||
"p-limit@^2.2.0": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1",
|
|
||||||
"p-locate@^4.1.0": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07",
|
|
||||||
"p-try@^2.0.0": "https://registry.nlark.com/p-try/download/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6",
|
|
||||||
"parent-module@^1.0.0": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2",
|
|
||||||
"parse5@6.0.1": "https://registry.npm.taobao.org/parse5/download/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b",
|
|
||||||
"path-exists@^4.0.0": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3",
|
|
||||||
"path-is-absolute@^1.0.0": "https://registry.nlark.com/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
|
||||||
"path-key@^3.0.0": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
|
||||||
"path-key@^3.1.0": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
|
||||||
"path-parse@^1.0.6": "https://registry.nlark.com/path-parse/download/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735",
|
|
||||||
"path-type@^4.0.0": "https://registry.nlark.com/path-type/download/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b",
|
|
||||||
"picomatch@^2.0.4": "https://registry.nlark.com/picomatch/download/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972",
|
|
||||||
"picomatch@^2.2.3": "https://registry.nlark.com/picomatch/download/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972",
|
|
||||||
"pirates@^4.0.1": "https://registry.npm.taobao.org/pirates/download/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87",
|
|
||||||
"pkg-dir@^4.2.0": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3",
|
|
||||||
"prelude-ls@^1.2.1": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396",
|
|
||||||
"prelude-ls@~1.1.2": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54",
|
|
||||||
"prettier-linter-helpers@^1.0.0": "https://registry.npm.taobao.org/prettier-linter-helpers/download/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b",
|
|
||||||
"prettier@^2.3.2": "https://registry.nlark.com/prettier/download/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d",
|
|
||||||
"pretty-format@^26.0.0": "https://registry.nlark.com/pretty-format/download/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93",
|
|
||||||
"pretty-format@^26.6.2": "https://registry.nlark.com/pretty-format/download/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93",
|
|
||||||
"pretty-format@^27.0.6": "https://registry.nlark.com/pretty-format/download/pretty-format-27.0.6.tgz#ab770c47b2c6f893a21aefc57b75da63ef49a11f",
|
|
||||||
"progress@^2.0.0": "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8",
|
|
||||||
"prompts@^2.0.1": "https://registry.npm.taobao.org/prompts/download/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61",
|
|
||||||
"psl@^1.1.33": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24",
|
|
||||||
"punycode@^2.1.0": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec",
|
|
||||||
"punycode@^2.1.1": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec",
|
|
||||||
"queue-microtask@^1.2.2": "https://registry.npm.taobao.org/queue-microtask/download/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243",
|
|
||||||
"react-is@^17.0.1": "https://registry.nlark.com/react-is/download/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0",
|
|
||||||
"regexpp@^3.1.0": "https://registry.nlark.com/regexpp/download/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2",
|
|
||||||
"require-directory@^2.1.1": "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42",
|
|
||||||
"require-from-string@^2.0.2": "https://registry.npm.taobao.org/require-from-string/download/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909",
|
|
||||||
"resolve-cwd@^3.0.0": "https://registry.npm.taobao.org/resolve-cwd/download/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d",
|
|
||||||
"resolve-from@^4.0.0": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6",
|
|
||||||
"resolve-from@^5.0.0": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69",
|
|
||||||
"resolve@^1.20.0": "https://registry.npm.taobao.org/resolve/download/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975",
|
|
||||||
"reusify@^1.0.4": "https://registry.npm.taobao.org/reusify/download/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76",
|
|
||||||
"rimraf@^3.0.0": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a",
|
|
||||||
"rimraf@^3.0.2": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a",
|
|
||||||
"run-parallel@^1.1.9": "https://registry.npm.taobao.org/run-parallel/download/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee",
|
|
||||||
"safe-buffer@~5.1.1": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
|
|
||||||
"safer-buffer@>= 2.1.2 < 3": "https://registry.nlark.com/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
|
|
||||||
"saxes@^5.0.1": "https://registry.npm.taobao.org/saxes/download/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d",
|
|
||||||
"semver@7.x": "https://registry.nlark.com/semver/download/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7",
|
|
||||||
"semver@^6.0.0": "https://registry.nlark.com/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
|
||||||
"semver@^6.1.0": "https://registry.nlark.com/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
|
||||||
"semver@^6.3.0": "https://registry.nlark.com/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
|
||||||
"semver@^7.2.1": "https://registry.nlark.com/semver/download/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7",
|
|
||||||
"semver@^7.3.2": "https://registry.nlark.com/semver/download/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7",
|
|
||||||
"semver@^7.3.5": "https://registry.nlark.com/semver/download/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7",
|
|
||||||
"shebang-command@^2.0.0": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea",
|
|
||||||
"shebang-regex@^3.0.0": "https://registry.nlark.com/shebang-regex/download/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172",
|
|
||||||
"signal-exit@^3.0.2": "https://registry.nlark.com/signal-exit/download/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c",
|
|
||||||
"signal-exit@^3.0.3": "https://registry.nlark.com/signal-exit/download/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c",
|
|
||||||
"sisteransi@^1.0.5": "https://registry.npm.taobao.org/sisteransi/download/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed",
|
|
||||||
"slash@^3.0.0": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634",
|
|
||||||
"slice-ansi@^4.0.0": "https://registry.npm.taobao.org/slice-ansi/download/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b",
|
|
||||||
"source-map-support@^0.5.6": "https://registry.nlark.com/source-map-support/download/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61",
|
|
||||||
"source-map@^0.5.0": "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc",
|
|
||||||
"source-map@^0.6.0": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
|
||||||
"source-map@^0.6.1": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
|
||||||
"source-map@^0.7.3": "https://registry.npm.taobao.org/source-map/download/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383",
|
|
||||||
"source-map@~0.6.1": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
|
||||||
"sprintf-js@~1.0.2": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c",
|
|
||||||
"stack-utils@^2.0.3": "https://registry.npm.taobao.org/stack-utils/download/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277",
|
|
||||||
"string-length@^4.0.1": "https://registry.nlark.com/string-length/download/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a",
|
|
||||||
"string-width@^4.1.0": "https://registry.npm.taobao.org/string-width/download/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5",
|
|
||||||
"string-width@^4.2.0": "https://registry.npm.taobao.org/string-width/download/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5",
|
|
||||||
"strip-ansi@^6.0.0": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532",
|
|
||||||
"strip-bom@^4.0.0": "https://registry.nlark.com/strip-bom/download/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878",
|
|
||||||
"strip-final-newline@^2.0.0": "https://registry.nlark.com/strip-final-newline/download/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad",
|
|
||||||
"strip-json-comments@^3.1.0": "https://registry.nlark.com/strip-json-comments/download/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006",
|
|
||||||
"strip-json-comments@^3.1.1": "https://registry.nlark.com/strip-json-comments/download/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006",
|
|
||||||
"supports-color@^5.3.0": "https://registry.nlark.com/supports-color/download/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f",
|
|
||||||
"supports-color@^7.0.0": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da",
|
|
||||||
"supports-color@^7.1.0": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da",
|
|
||||||
"supports-color@^8.0.0": "https://registry.nlark.com/supports-color/download/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c",
|
|
||||||
"supports-hyperlinks@^2.0.0": "https://registry.npm.taobao.org/supports-hyperlinks/download/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb",
|
|
||||||
"symbol-tree@^3.2.4": "https://registry.npm.taobao.org/symbol-tree/download/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2",
|
|
||||||
"table@^6.0.9": "https://registry.nlark.com/table/download/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2",
|
|
||||||
"terminal-link@^2.0.0": "https://registry.npm.taobao.org/terminal-link/download/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994",
|
|
||||||
"test-exclude@^6.0.0": "https://registry.npm.taobao.org/test-exclude/download/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e",
|
|
||||||
"text-table@^0.2.0": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4",
|
|
||||||
"throat@^6.0.1": "https://registry.npm.taobao.org/throat/download/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375",
|
|
||||||
"tmpl@1.0.x": "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc",
|
|
||||||
"to-fast-properties@^2.0.0": "https://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e",
|
|
||||||
"to-regex-range@^5.0.1": "https://registry.nlark.com/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4",
|
|
||||||
"tough-cookie@^4.0.0": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4",
|
|
||||||
"tr46@^2.1.0": "https://registry.nlark.com/tr46/download/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240",
|
|
||||||
"ts-jest@^27.0.3": "https://registry.nlark.com/ts-jest/download/ts-jest-27.0.3.tgz#808492f022296cde19390bb6ad627c8126bf93f8",
|
|
||||||
"tslib@^1.8.1": "https://registry.nlark.com/tslib/download/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00",
|
|
||||||
"tsutils@^3.21.0": "https://registry.npm.taobao.org/tsutils/download/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623",
|
|
||||||
"tunnel@0.0.6": "https://registry.npm.taobao.org/tunnel/download/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c",
|
|
||||||
"tunnel@^0.0.6": "https://registry.npm.taobao.org/tunnel/download/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c",
|
|
||||||
"type-check@^0.4.0": "https://registry.npm.taobao.org/type-check/download/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1",
|
|
||||||
"type-check@~0.3.2": "https://registry.npm.taobao.org/type-check/download/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72",
|
|
||||||
"type-check@~0.4.0": "https://registry.npm.taobao.org/type-check/download/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1",
|
|
||||||
"type-detect@4.0.8": "https://registry.npm.taobao.org/type-detect/download/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c",
|
|
||||||
"type-fest@^0.20.2": "https://registry.nlark.com/type-fest/download/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4",
|
|
||||||
"type-fest@^0.21.3": "https://registry.nlark.com/type-fest/download/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37",
|
|
||||||
"type-fest@^1.2.2": "https://registry.nlark.com/type-fest/download/type-fest-1.2.2.tgz#1930bc36b2064f7ab4aa307a6d1b65965199c698",
|
|
||||||
"typedarray-to-buffer@^3.1.5": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080",
|
|
||||||
"typescript@^4.3.5": "https://registry.nlark.com/typescript/download/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4",
|
|
||||||
"universalify@^0.1.2": "https://registry.nlark.com/universalify/download/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66",
|
|
||||||
"uri-js@^4.2.2": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e",
|
|
||||||
"uuid@^3.3.2": "https://registry.nlark.com/uuid/download/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee",
|
|
||||||
"uuid@^8.3.2": "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2",
|
|
||||||
"v8-compile-cache@^2.0.3": "https://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee",
|
|
||||||
"v8-to-istanbul@^8.0.0": "https://registry.nlark.com/v8-to-istanbul/download/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c",
|
|
||||||
"w3c-hr-time@^1.0.2": "https://registry.npm.taobao.org/w3c-hr-time/download/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd",
|
|
||||||
"w3c-xmlserializer@^2.0.0": "https://registry.npm.taobao.org/w3c-xmlserializer/download/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a",
|
|
||||||
"walker@^1.0.7": "https://registry.npm.taobao.org/walker/download/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb",
|
|
||||||
"webidl-conversions@^5.0.0": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff",
|
|
||||||
"webidl-conversions@^6.1.0": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514",
|
|
||||||
"whatwg-encoding@^1.0.5": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0",
|
|
||||||
"whatwg-mimetype@^2.3.0": "https://registry.npm.taobao.org/whatwg-mimetype/download/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf",
|
|
||||||
"whatwg-url@^8.0.0": "https://registry.nlark.com/whatwg-url/download/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77",
|
|
||||||
"whatwg-url@^8.5.0": "https://registry.nlark.com/whatwg-url/download/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77",
|
|
||||||
"which@^2.0.1": "https://registry.nlark.com/which/download/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1",
|
|
||||||
"word-wrap@^1.2.3": "https://registry.npm.taobao.org/word-wrap/download/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c",
|
|
||||||
"word-wrap@~1.2.3": "https://registry.npm.taobao.org/word-wrap/download/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c",
|
|
||||||
"wrap-ansi@^7.0.0": "https://registry.nlark.com/wrap-ansi/download/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43",
|
|
||||||
"wrappy@1": "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
|
|
||||||
"write-file-atomic@^3.0.0": "https://registry.nlark.com/write-file-atomic/download/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8",
|
|
||||||
"ws@^7.4.5": "https://registry.nlark.com/ws/download/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74",
|
|
||||||
"xml-name-validator@^3.0.0": "https://registry.npm.taobao.org/xml-name-validator/download/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a",
|
|
||||||
"xmlchars@^2.2.0": "https://registry.npm.taobao.org/xmlchars/download/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb",
|
|
||||||
"y18n@^5.0.5": "https://registry.npm.taobao.org/y18n/download/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55",
|
|
||||||
"yallist@^4.0.0": "https://registry.nlark.com/yallist/download/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72",
|
|
||||||
"yargs-parser@20.x": "https://registry.nlark.com/yargs-parser/download/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee",
|
|
||||||
"yargs-parser@^20.2.2": "https://registry.nlark.com/yargs-parser/download/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee",
|
|
||||||
"yargs@^16.0.3": "https://registry.nlark.com/yargs/download/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
|
|
||||||
},
|
|
||||||
"files": [],
|
|
||||||
"artifacts": {}
|
|
||||||
}
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
-335
@@ -1,335 +0,0 @@
|
|||||||
# `@actions/core`
|
|
||||||
|
|
||||||
> Core functions for setting results, logging, registering secrets and exporting variables across actions
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Import the package
|
|
||||||
|
|
||||||
```js
|
|
||||||
// javascript
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
// typescript
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inputs/Outputs
|
|
||||||
|
|
||||||
Action inputs can be read with `getInput` which returns a `string` or `getBooleanInput` which parses a boolean based on the [yaml 1.2 specification](https://yaml.org/spec/1.2/spec.html#id2804923). If `required` set to be false, the input should have a default value in `action.yml`.
|
|
||||||
|
|
||||||
Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const myInput = core.getInput('inputName', { required: true });
|
|
||||||
const myBooleanInput = core.getBooleanInput('booleanInputName', { required: true });
|
|
||||||
const myMultilineInput = core.getMultilineInput('multilineInputName', { required: true });
|
|
||||||
core.setOutput('outputKey', 'outputVal');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Exporting variables
|
|
||||||
|
|
||||||
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.exportVariable('envVar', 'Val');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Setting a secret
|
|
||||||
|
|
||||||
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.setSecret('myPassword');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### PATH Manipulation
|
|
||||||
|
|
||||||
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.addPath('/path/to/mytool');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Exit codes
|
|
||||||
|
|
||||||
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Do stuff
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// setFailed logs the message and sets a failing exit code
|
|
||||||
core.setFailed(`Action failed with error ${err}`);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
|
||||||
|
|
||||||
#### Logging
|
|
||||||
|
|
||||||
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
const myInput = core.getInput('input');
|
|
||||||
try {
|
|
||||||
core.debug('Inside try block');
|
|
||||||
|
|
||||||
if (!myInput) {
|
|
||||||
core.warning('myInput was not set');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
// curl -v https://github.com
|
|
||||||
} else {
|
|
||||||
// curl https://github.com
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do stuff
|
|
||||||
core.info('Output to the actions build log')
|
|
||||||
|
|
||||||
core.notice('This is a message that will also emit an annotation')
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
core.error(`Error ${err}, action may still succeed though`);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This library can also wrap chunks of output in foldable groups.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core')
|
|
||||||
|
|
||||||
// Manually wrap output
|
|
||||||
core.startGroup('Do some function')
|
|
||||||
doSomeFunction()
|
|
||||||
core.endGroup()
|
|
||||||
|
|
||||||
// Wrap an asynchronous function call
|
|
||||||
const result = await core.group('Do something async', async () => {
|
|
||||||
const response = await doSomeHTTPRequest()
|
|
||||||
return response
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Annotations
|
|
||||||
|
|
||||||
This library has 3 methods that will produce [annotations](https://docs.github.com/en/rest/reference/checks#create-a-check-run).
|
|
||||||
```js
|
|
||||||
core.error('This is a bad error. This will also fail the build.')
|
|
||||||
|
|
||||||
core.warning('Something went wrong, but it\'s not bad enough to fail the build.')
|
|
||||||
|
|
||||||
core.notice('Something happened that you might want to know about.')
|
|
||||||
```
|
|
||||||
|
|
||||||
These will surface to the UI in the Actions page and on Pull Requests. They look something like this:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
These annotations can also be attached to particular lines and columns of your source files to show exactly where a problem is occuring.
|
|
||||||
|
|
||||||
These options are:
|
|
||||||
```typescript
|
|
||||||
export interface AnnotationProperties {
|
|
||||||
/**
|
|
||||||
* A title for the annotation.
|
|
||||||
*/
|
|
||||||
title?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The name of the file for which the annotation should be created.
|
|
||||||
*/
|
|
||||||
file?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The start line for the annotation.
|
|
||||||
*/
|
|
||||||
startLine?: number
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The end line for the annotation. Defaults to `startLine` when `startLine` is provided.
|
|
||||||
*/
|
|
||||||
endLine?: number
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
|
||||||
*/
|
|
||||||
startColumn?: number
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
|
||||||
* Defaults to `startColumn` when `startColumn` is provided.
|
|
||||||
*/
|
|
||||||
endColumn?: number
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Styling output
|
|
||||||
|
|
||||||
Colored output is supported in the Action logs via standard [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). 3/4 bit, 8 bit and 24 bit colors are all supported.
|
|
||||||
|
|
||||||
Foreground colors:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// 3/4 bit
|
|
||||||
core.info('\u001b[35mThis foreground will be magenta')
|
|
||||||
|
|
||||||
// 8 bit
|
|
||||||
core.info('\u001b[38;5;6mThis foreground will be cyan')
|
|
||||||
|
|
||||||
// 24 bit
|
|
||||||
core.info('\u001b[38;2;255;0;0mThis foreground will be bright red')
|
|
||||||
```
|
|
||||||
|
|
||||||
Background colors:
|
|
||||||
|
|
||||||
```js
|
|
||||||
// 3/4 bit
|
|
||||||
core.info('\u001b[43mThis background will be yellow');
|
|
||||||
|
|
||||||
// 8 bit
|
|
||||||
core.info('\u001b[48;5;6mThis background will be cyan')
|
|
||||||
|
|
||||||
// 24 bit
|
|
||||||
core.info('\u001b[48;2;255;0;0mThis background will be bright red')
|
|
||||||
```
|
|
||||||
|
|
||||||
Special styles:
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.info('\u001b[1mBold text')
|
|
||||||
core.info('\u001b[3mItalic text')
|
|
||||||
core.info('\u001b[4mUnderlined text')
|
|
||||||
```
|
|
||||||
|
|
||||||
ANSI escape codes can be combined with one another:
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.info('\u001b[31;46mRed foreground with a cyan background and \u001b[1mbold text at the end');
|
|
||||||
```
|
|
||||||
|
|
||||||
> Note: Escape codes reset at the start of each line
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.info('\u001b[35mThis foreground will be magenta')
|
|
||||||
core.info('This foreground will reset to the default')
|
|
||||||
```
|
|
||||||
|
|
||||||
Manually typing escape codes can be a little difficult, but you can use third party modules such as [ansi-styles](https://github.com/chalk/ansi-styles).
|
|
||||||
|
|
||||||
```js
|
|
||||||
const style = require('ansi-styles');
|
|
||||||
core.info(style.color.ansi16m.hex('#abcdef') + 'Hello world!')
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Action state
|
|
||||||
|
|
||||||
You can use this library to save state and get state for sharing information between a given wrapper action:
|
|
||||||
|
|
||||||
**action.yml**:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: 'Wrapper action sample'
|
|
||||||
inputs:
|
|
||||||
name:
|
|
||||||
default: 'GitHub'
|
|
||||||
runs:
|
|
||||||
using: 'node12'
|
|
||||||
main: 'main.js'
|
|
||||||
post: 'cleanup.js'
|
|
||||||
```
|
|
||||||
|
|
||||||
In action's `main.js`:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
core.saveState("pidToKill", 12345);
|
|
||||||
```
|
|
||||||
|
|
||||||
In action's `cleanup.js`:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
var pid = core.getState("pidToKill");
|
|
||||||
|
|
||||||
process.kill(pid);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### OIDC Token
|
|
||||||
|
|
||||||
You can use these methods to interact with the GitHub OIDC provider and get a JWT ID token which would help to get access token from third party cloud providers.
|
|
||||||
|
|
||||||
**Method Name**: getIDToken()
|
|
||||||
|
|
||||||
**Inputs**
|
|
||||||
|
|
||||||
audience : optional
|
|
||||||
|
|
||||||
**Outputs**
|
|
||||||
|
|
||||||
A [JWT](https://jwt.io/) ID Token
|
|
||||||
|
|
||||||
In action's `main.ts`:
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
async function getIDTokenAction(): Promise<void> {
|
|
||||||
|
|
||||||
const audience = core.getInput('audience', {required: false})
|
|
||||||
|
|
||||||
const id_token1 = await core.getIDToken() // ID Token with default audience
|
|
||||||
const id_token2 = await core.getIDToken(audience) // ID token with custom audience
|
|
||||||
|
|
||||||
// this id_token can be used to get access token from third party cloud providers
|
|
||||||
}
|
|
||||||
getIDTokenAction()
|
|
||||||
```
|
|
||||||
|
|
||||||
In action's `actions.yml`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: 'GetIDToken'
|
|
||||||
description: 'Get ID token from Github OIDC provider'
|
|
||||||
inputs:
|
|
||||||
audience:
|
|
||||||
description: 'Audience for which the ID token is intended for'
|
|
||||||
required: false
|
|
||||||
outputs:
|
|
||||||
id_token1:
|
|
||||||
description: 'ID token obtained from OIDC provider'
|
|
||||||
id_token2:
|
|
||||||
description: 'ID token obtained from OIDC provider'
|
|
||||||
runs:
|
|
||||||
using: 'node12'
|
|
||||||
main: 'dist/index.js'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Filesystem path helpers
|
|
||||||
|
|
||||||
You can use these methods to manipulate file paths across operating systems.
|
|
||||||
|
|
||||||
The `toPosixPath` function converts input paths to Posix-style (Linux) paths.
|
|
||||||
The `toWin32Path` function converts input paths to Windows-style paths. These
|
|
||||||
functions work independently of the underlying runner operating system.
|
|
||||||
|
|
||||||
```js
|
|
||||||
toPosixPath('\\foo\\bar') // => /foo/bar
|
|
||||||
toWin32Path('/foo/bar') // => \foo\bar
|
|
||||||
```
|
|
||||||
|
|
||||||
The `toPlatformPath` function converts input paths to the expected value on the runner's operating system.
|
|
||||||
|
|
||||||
```js
|
|
||||||
// On a Windows runner.
|
|
||||||
toPlatformPath('/foo/bar') // => \foo\bar
|
|
||||||
|
|
||||||
// On a Linux runner.
|
|
||||||
toPlatformPath('\\foo\\bar') // => /foo/bar
|
|
||||||
```
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
export interface CommandProperties {
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Commands
|
|
||||||
*
|
|
||||||
* Command Format:
|
|
||||||
* ::name key=value,key=value::message
|
|
||||||
*
|
|
||||||
* Examples:
|
|
||||||
* ::warning::This is the message
|
|
||||||
* ::set-env name=MY_VAR::some value
|
|
||||||
*/
|
|
||||||
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
|
|
||||||
export declare function issue(name: string, message?: string): void;
|
|
||||||
-92
@@ -1,92 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.issue = exports.issueCommand = void 0;
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
const utils_1 = require("./utils");
|
|
||||||
/**
|
|
||||||
* Commands
|
|
||||||
*
|
|
||||||
* Command Format:
|
|
||||||
* ::name key=value,key=value::message
|
|
||||||
*
|
|
||||||
* Examples:
|
|
||||||
* ::warning::This is the message
|
|
||||||
* ::set-env name=MY_VAR::some value
|
|
||||||
*/
|
|
||||||
function issueCommand(command, properties, message) {
|
|
||||||
const cmd = new Command(command, properties, message);
|
|
||||||
process.stdout.write(cmd.toString() + os.EOL);
|
|
||||||
}
|
|
||||||
exports.issueCommand = issueCommand;
|
|
||||||
function issue(name, message = '') {
|
|
||||||
issueCommand(name, {}, message);
|
|
||||||
}
|
|
||||||
exports.issue = issue;
|
|
||||||
const CMD_STRING = '::';
|
|
||||||
class Command {
|
|
||||||
constructor(command, properties, message) {
|
|
||||||
if (!command) {
|
|
||||||
command = 'missing.command';
|
|
||||||
}
|
|
||||||
this.command = command;
|
|
||||||
this.properties = properties;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
toString() {
|
|
||||||
let cmdStr = CMD_STRING + this.command;
|
|
||||||
if (this.properties && Object.keys(this.properties).length > 0) {
|
|
||||||
cmdStr += ' ';
|
|
||||||
let first = true;
|
|
||||||
for (const key in this.properties) {
|
|
||||||
if (this.properties.hasOwnProperty(key)) {
|
|
||||||
const val = this.properties[key];
|
|
||||||
if (val) {
|
|
||||||
if (first) {
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cmdStr += ',';
|
|
||||||
}
|
|
||||||
cmdStr += `${key}=${escapeProperty(val)}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
|
|
||||||
return cmdStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function escapeData(s) {
|
|
||||||
return utils_1.toCommandValue(s)
|
|
||||||
.replace(/%/g, '%25')
|
|
||||||
.replace(/\r/g, '%0D')
|
|
||||||
.replace(/\n/g, '%0A');
|
|
||||||
}
|
|
||||||
function escapeProperty(s) {
|
|
||||||
return utils_1.toCommandValue(s)
|
|
||||||
.replace(/%/g, '%25')
|
|
||||||
.replace(/\r/g, '%0D')
|
|
||||||
.replace(/\n/g, '%0A')
|
|
||||||
.replace(/:/g, '%3A')
|
|
||||||
.replace(/,/g, '%2C');
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=command.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,mCAAsC;AAWtC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC9C,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
|
||||||
-198
@@ -1,198 +0,0 @@
|
|||||||
/**
|
|
||||||
* Interface for getInput options
|
|
||||||
*/
|
|
||||||
export interface InputOptions {
|
|
||||||
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
|
||||||
required?: boolean;
|
|
||||||
/** Optional. Whether leading/trailing whitespace will be trimmed for the input. Defaults to true */
|
|
||||||
trimWhitespace?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The code to exit an action
|
|
||||||
*/
|
|
||||||
export declare enum ExitCode {
|
|
||||||
/**
|
|
||||||
* A code indicating that the action was successful
|
|
||||||
*/
|
|
||||||
Success = 0,
|
|
||||||
/**
|
|
||||||
* A code indicating that the action was a failure
|
|
||||||
*/
|
|
||||||
Failure = 1
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Optional properties that can be sent with annotatation commands (notice, error, and warning)
|
|
||||||
* See: https://docs.github.com/en/rest/reference/checks#create-a-check-run for more information about annotations.
|
|
||||||
*/
|
|
||||||
export interface AnnotationProperties {
|
|
||||||
/**
|
|
||||||
* A title for the annotation.
|
|
||||||
*/
|
|
||||||
title?: string;
|
|
||||||
/**
|
|
||||||
* The path of the file for which the annotation should be created.
|
|
||||||
*/
|
|
||||||
file?: string;
|
|
||||||
/**
|
|
||||||
* The start line for the annotation.
|
|
||||||
*/
|
|
||||||
startLine?: number;
|
|
||||||
/**
|
|
||||||
* The end line for the annotation. Defaults to `startLine` when `startLine` is provided.
|
|
||||||
*/
|
|
||||||
endLine?: number;
|
|
||||||
/**
|
|
||||||
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
|
||||||
*/
|
|
||||||
startColumn?: number;
|
|
||||||
/**
|
|
||||||
* The start column for the annotation. Cannot be sent when `startLine` and `endLine` are different values.
|
|
||||||
* Defaults to `startColumn` when `startColumn` is provided.
|
|
||||||
*/
|
|
||||||
endColumn?: number;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Sets env variable for this action and future actions in the job
|
|
||||||
* @param name the name of the variable to set
|
|
||||||
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
export declare function exportVariable(name: string, val: any): void;
|
|
||||||
/**
|
|
||||||
* Registers a secret which will get masked from logs
|
|
||||||
* @param secret value of the secret
|
|
||||||
*/
|
|
||||||
export declare function setSecret(secret: string): void;
|
|
||||||
/**
|
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
|
||||||
* @param inputPath
|
|
||||||
*/
|
|
||||||
export declare function addPath(inputPath: string): void;
|
|
||||||
/**
|
|
||||||
* Gets the value of an input.
|
|
||||||
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
|
|
||||||
* Returns an empty string if the value is not defined.
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
export declare function getInput(name: string, options?: InputOptions): string;
|
|
||||||
/**
|
|
||||||
* Gets the values of an multiline input. Each value is also trimmed.
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns string[]
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export declare function getMultilineInput(name: string, options?: InputOptions): string[];
|
|
||||||
/**
|
|
||||||
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
|
|
||||||
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
|
|
||||||
* The return value is also in boolean type.
|
|
||||||
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns boolean
|
|
||||||
*/
|
|
||||||
export declare function getBooleanInput(name: string, options?: InputOptions): boolean;
|
|
||||||
/**
|
|
||||||
* Sets the value of an output.
|
|
||||||
*
|
|
||||||
* @param name name of the output to set
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
export declare function setOutput(name: string, value: any): void;
|
|
||||||
/**
|
|
||||||
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
|
||||||
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export declare function setCommandEcho(enabled: boolean): void;
|
|
||||||
/**
|
|
||||||
* Sets the action status to failed.
|
|
||||||
* When the action exits it will be with an exit code of 1
|
|
||||||
* @param message add error issue message
|
|
||||||
*/
|
|
||||||
export declare function setFailed(message: string | Error): void;
|
|
||||||
/**
|
|
||||||
* Gets whether Actions Step Debug is on or not
|
|
||||||
*/
|
|
||||||
export declare function isDebug(): boolean;
|
|
||||||
/**
|
|
||||||
* Writes debug message to user log
|
|
||||||
* @param message debug message
|
|
||||||
*/
|
|
||||||
export declare function debug(message: string): void;
|
|
||||||
/**
|
|
||||||
* Adds an error issue
|
|
||||||
* @param message error issue message. Errors will be converted to string via toString()
|
|
||||||
* @param properties optional properties to add to the annotation.
|
|
||||||
*/
|
|
||||||
export declare function error(message: string | Error, properties?: AnnotationProperties): void;
|
|
||||||
/**
|
|
||||||
* Adds a warning issue
|
|
||||||
* @param message warning issue message. Errors will be converted to string via toString()
|
|
||||||
* @param properties optional properties to add to the annotation.
|
|
||||||
*/
|
|
||||||
export declare function warning(message: string | Error, properties?: AnnotationProperties): void;
|
|
||||||
/**
|
|
||||||
* Adds a notice issue
|
|
||||||
* @param message notice issue message. Errors will be converted to string via toString()
|
|
||||||
* @param properties optional properties to add to the annotation.
|
|
||||||
*/
|
|
||||||
export declare function notice(message: string | Error, properties?: AnnotationProperties): void;
|
|
||||||
/**
|
|
||||||
* Writes info to log with console.log.
|
|
||||||
* @param message info message
|
|
||||||
*/
|
|
||||||
export declare function info(message: string): void;
|
|
||||||
/**
|
|
||||||
* Begin an output group.
|
|
||||||
*
|
|
||||||
* Output until the next `groupEnd` will be foldable in this group
|
|
||||||
*
|
|
||||||
* @param name The name of the output group
|
|
||||||
*/
|
|
||||||
export declare function startGroup(name: string): void;
|
|
||||||
/**
|
|
||||||
* End an output group.
|
|
||||||
*/
|
|
||||||
export declare function endGroup(): void;
|
|
||||||
/**
|
|
||||||
* Wrap an asynchronous function call in a group.
|
|
||||||
*
|
|
||||||
* Returns the same type as the function itself.
|
|
||||||
*
|
|
||||||
* @param name The name of the group
|
|
||||||
* @param fn The function to wrap in the group
|
|
||||||
*/
|
|
||||||
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
||||||
/**
|
|
||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to store
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
export declare function saveState(name: string, value: any): void;
|
|
||||||
/**
|
|
||||||
* Gets the value of an state set by this action's main execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to get
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
export declare function getState(name: string): string;
|
|
||||||
export declare function getIDToken(aud?: string): Promise<string>;
|
|
||||||
/**
|
|
||||||
* Summary exports
|
|
||||||
*/
|
|
||||||
export { summary } from './summary';
|
|
||||||
/**
|
|
||||||
* @deprecated use core.summary
|
|
||||||
*/
|
|
||||||
export { markdownSummary } from './summary';
|
|
||||||
/**
|
|
||||||
* Path exports
|
|
||||||
*/
|
|
||||||
export { toPosixPath, toWin32Path, toPlatformPath } from './path-utils';
|
|
||||||
-337
@@ -1,337 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
|
||||||
const command_1 = require("./command");
|
|
||||||
const file_command_1 = require("./file-command");
|
|
||||||
const utils_1 = require("./utils");
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
const path = __importStar(require("path"));
|
|
||||||
const uuid_1 = require("uuid");
|
|
||||||
const oidc_utils_1 = require("./oidc-utils");
|
|
||||||
/**
|
|
||||||
* The code to exit an action
|
|
||||||
*/
|
|
||||||
var ExitCode;
|
|
||||||
(function (ExitCode) {
|
|
||||||
/**
|
|
||||||
* A code indicating that the action was successful
|
|
||||||
*/
|
|
||||||
ExitCode[ExitCode["Success"] = 0] = "Success";
|
|
||||||
/**
|
|
||||||
* A code indicating that the action was a failure
|
|
||||||
*/
|
|
||||||
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
|
||||||
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Variables
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Sets env variable for this action and future actions in the job
|
|
||||||
* @param name the name of the variable to set
|
|
||||||
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
function exportVariable(name, val) {
|
|
||||||
const convertedVal = utils_1.toCommandValue(val);
|
|
||||||
process.env[name] = convertedVal;
|
|
||||||
const filePath = process.env['GITHUB_ENV'] || '';
|
|
||||||
if (filePath) {
|
|
||||||
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
|
||||||
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
|
|
||||||
if (name.includes(delimiter)) {
|
|
||||||
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
|
|
||||||
}
|
|
||||||
if (convertedVal.includes(delimiter)) {
|
|
||||||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
|
||||||
}
|
|
||||||
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
|
|
||||||
file_command_1.issueCommand('ENV', commandValue);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
command_1.issueCommand('set-env', { name }, convertedVal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.exportVariable = exportVariable;
|
|
||||||
/**
|
|
||||||
* Registers a secret which will get masked from logs
|
|
||||||
* @param secret value of the secret
|
|
||||||
*/
|
|
||||||
function setSecret(secret) {
|
|
||||||
command_1.issueCommand('add-mask', {}, secret);
|
|
||||||
}
|
|
||||||
exports.setSecret = setSecret;
|
|
||||||
/**
|
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
|
||||||
* @param inputPath
|
|
||||||
*/
|
|
||||||
function addPath(inputPath) {
|
|
||||||
const filePath = process.env['GITHUB_PATH'] || '';
|
|
||||||
if (filePath) {
|
|
||||||
file_command_1.issueCommand('PATH', inputPath);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
command_1.issueCommand('add-path', {}, inputPath);
|
|
||||||
}
|
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
|
||||||
}
|
|
||||||
exports.addPath = addPath;
|
|
||||||
/**
|
|
||||||
* Gets the value of an input.
|
|
||||||
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
|
|
||||||
* Returns an empty string if the value is not defined.
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
function getInput(name, options) {
|
|
||||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
|
||||||
if (options && options.required && !val) {
|
|
||||||
throw new Error(`Input required and not supplied: ${name}`);
|
|
||||||
}
|
|
||||||
if (options && options.trimWhitespace === false) {
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
return val.trim();
|
|
||||||
}
|
|
||||||
exports.getInput = getInput;
|
|
||||||
/**
|
|
||||||
* Gets the values of an multiline input. Each value is also trimmed.
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns string[]
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function getMultilineInput(name, options) {
|
|
||||||
const inputs = getInput(name, options)
|
|
||||||
.split('\n')
|
|
||||||
.filter(x => x !== '');
|
|
||||||
return inputs;
|
|
||||||
}
|
|
||||||
exports.getMultilineInput = getMultilineInput;
|
|
||||||
/**
|
|
||||||
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
|
|
||||||
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
|
|
||||||
* The return value is also in boolean type.
|
|
||||||
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns boolean
|
|
||||||
*/
|
|
||||||
function getBooleanInput(name, options) {
|
|
||||||
const trueValue = ['true', 'True', 'TRUE'];
|
|
||||||
const falseValue = ['false', 'False', 'FALSE'];
|
|
||||||
const val = getInput(name, options);
|
|
||||||
if (trueValue.includes(val))
|
|
||||||
return true;
|
|
||||||
if (falseValue.includes(val))
|
|
||||||
return false;
|
|
||||||
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
|
|
||||||
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
|
||||||
}
|
|
||||||
exports.getBooleanInput = getBooleanInput;
|
|
||||||
/**
|
|
||||||
* Sets the value of an output.
|
|
||||||
*
|
|
||||||
* @param name name of the output to set
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
function setOutput(name, value) {
|
|
||||||
process.stdout.write(os.EOL);
|
|
||||||
command_1.issueCommand('set-output', { name }, value);
|
|
||||||
}
|
|
||||||
exports.setOutput = setOutput;
|
|
||||||
/**
|
|
||||||
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
|
||||||
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function setCommandEcho(enabled) {
|
|
||||||
command_1.issue('echo', enabled ? 'on' : 'off');
|
|
||||||
}
|
|
||||||
exports.setCommandEcho = setCommandEcho;
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Results
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Sets the action status to failed.
|
|
||||||
* When the action exits it will be with an exit code of 1
|
|
||||||
* @param message add error issue message
|
|
||||||
*/
|
|
||||||
function setFailed(message) {
|
|
||||||
process.exitCode = ExitCode.Failure;
|
|
||||||
error(message);
|
|
||||||
}
|
|
||||||
exports.setFailed = setFailed;
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Logging Commands
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Gets whether Actions Step Debug is on or not
|
|
||||||
*/
|
|
||||||
function isDebug() {
|
|
||||||
return process.env['RUNNER_DEBUG'] === '1';
|
|
||||||
}
|
|
||||||
exports.isDebug = isDebug;
|
|
||||||
/**
|
|
||||||
* Writes debug message to user log
|
|
||||||
* @param message debug message
|
|
||||||
*/
|
|
||||||
function debug(message) {
|
|
||||||
command_1.issueCommand('debug', {}, message);
|
|
||||||
}
|
|
||||||
exports.debug = debug;
|
|
||||||
/**
|
|
||||||
* Adds an error issue
|
|
||||||
* @param message error issue message. Errors will be converted to string via toString()
|
|
||||||
* @param properties optional properties to add to the annotation.
|
|
||||||
*/
|
|
||||||
function error(message, properties = {}) {
|
|
||||||
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
||||||
}
|
|
||||||
exports.error = error;
|
|
||||||
/**
|
|
||||||
* Adds a warning issue
|
|
||||||
* @param message warning issue message. Errors will be converted to string via toString()
|
|
||||||
* @param properties optional properties to add to the annotation.
|
|
||||||
*/
|
|
||||||
function warning(message, properties = {}) {
|
|
||||||
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
||||||
}
|
|
||||||
exports.warning = warning;
|
|
||||||
/**
|
|
||||||
* Adds a notice issue
|
|
||||||
* @param message notice issue message. Errors will be converted to string via toString()
|
|
||||||
* @param properties optional properties to add to the annotation.
|
|
||||||
*/
|
|
||||||
function notice(message, properties = {}) {
|
|
||||||
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
||||||
}
|
|
||||||
exports.notice = notice;
|
|
||||||
/**
|
|
||||||
* Writes info to log with console.log.
|
|
||||||
* @param message info message
|
|
||||||
*/
|
|
||||||
function info(message) {
|
|
||||||
process.stdout.write(message + os.EOL);
|
|
||||||
}
|
|
||||||
exports.info = info;
|
|
||||||
/**
|
|
||||||
* Begin an output group.
|
|
||||||
*
|
|
||||||
* Output until the next `groupEnd` will be foldable in this group
|
|
||||||
*
|
|
||||||
* @param name The name of the output group
|
|
||||||
*/
|
|
||||||
function startGroup(name) {
|
|
||||||
command_1.issue('group', name);
|
|
||||||
}
|
|
||||||
exports.startGroup = startGroup;
|
|
||||||
/**
|
|
||||||
* End an output group.
|
|
||||||
*/
|
|
||||||
function endGroup() {
|
|
||||||
command_1.issue('endgroup');
|
|
||||||
}
|
|
||||||
exports.endGroup = endGroup;
|
|
||||||
/**
|
|
||||||
* Wrap an asynchronous function call in a group.
|
|
||||||
*
|
|
||||||
* Returns the same type as the function itself.
|
|
||||||
*
|
|
||||||
* @param name The name of the group
|
|
||||||
* @param fn The function to wrap in the group
|
|
||||||
*/
|
|
||||||
function group(name, fn) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
startGroup(name);
|
|
||||||
let result;
|
|
||||||
try {
|
|
||||||
result = yield fn();
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
endGroup();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.group = group;
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Wrapper action state
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to store
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
function saveState(name, value) {
|
|
||||||
command_1.issueCommand('save-state', { name }, value);
|
|
||||||
}
|
|
||||||
exports.saveState = saveState;
|
|
||||||
/**
|
|
||||||
* Gets the value of an state set by this action's main execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to get
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
function getState(name) {
|
|
||||||
return process.env[`STATE_${name}`] || '';
|
|
||||||
}
|
|
||||||
exports.getState = getState;
|
|
||||||
function getIDToken(aud) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return yield oidc_utils_1.OidcClient.getIDToken(aud);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.getIDToken = getIDToken;
|
|
||||||
/**
|
|
||||||
* Summary exports
|
|
||||||
*/
|
|
||||||
var summary_1 = require("./summary");
|
|
||||||
Object.defineProperty(exports, "summary", { enumerable: true, get: function () { return summary_1.summary; } });
|
|
||||||
/**
|
|
||||||
* @deprecated use core.summary
|
|
||||||
*/
|
|
||||||
var summary_2 = require("./summary");
|
|
||||||
Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function () { return summary_2.markdownSummary; } });
|
|
||||||
/**
|
|
||||||
* Path exports
|
|
||||||
*/
|
|
||||||
var path_utils_1 = require("./path-utils");
|
|
||||||
Object.defineProperty(exports, "toPosixPath", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });
|
|
||||||
Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });
|
|
||||||
Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });
|
|
||||||
//# sourceMappingURL=core.js.map
|
|
||||||
-1
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
|||||||
export declare function issueCommand(command: string, message: any): void;
|
|
||||||
-42
@@ -1,42 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
// For internal use, subject to change.
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.issueCommand = void 0;
|
|
||||||
// We use any as a valid input type
|
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
const fs = __importStar(require("fs"));
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
const utils_1 = require("./utils");
|
|
||||||
function issueCommand(command, message) {
|
|
||||||
const filePath = process.env[`GITHUB_${command}`];
|
|
||||||
if (!filePath) {
|
|
||||||
throw new Error(`Unable to find environment variable for file command ${command}`);
|
|
||||||
}
|
|
||||||
if (!fs.existsSync(filePath)) {
|
|
||||||
throw new Error(`Missing file at path: ${filePath}`);
|
|
||||||
}
|
|
||||||
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
|
|
||||||
encoding: 'utf8'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.issueCommand = issueCommand;
|
|
||||||
//# sourceMappingURL=file-command.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;;;;;;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,YAAY,CAAC,OAAe,EAAE,OAAY;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,oCAcC"}
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
export declare class OidcClient {
|
|
||||||
private static createHttpClient;
|
|
||||||
private static getRequestToken;
|
|
||||||
private static getIDTokenUrl;
|
|
||||||
private static getCall;
|
|
||||||
static getIDToken(audience?: string): Promise<string>;
|
|
||||||
}
|
|
||||||
-77
@@ -1,77 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.OidcClient = void 0;
|
|
||||||
const http_client_1 = require("@actions/http-client");
|
|
||||||
const auth_1 = require("@actions/http-client/lib/auth");
|
|
||||||
const core_1 = require("./core");
|
|
||||||
class OidcClient {
|
|
||||||
static createHttpClient(allowRetry = true, maxRetry = 10) {
|
|
||||||
const requestOptions = {
|
|
||||||
allowRetries: allowRetry,
|
|
||||||
maxRetries: maxRetry
|
|
||||||
};
|
|
||||||
return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
|
|
||||||
}
|
|
||||||
static getRequestToken() {
|
|
||||||
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
|
|
||||||
if (!token) {
|
|
||||||
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
|
|
||||||
}
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
static getIDTokenUrl() {
|
|
||||||
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
|
|
||||||
if (!runtimeUrl) {
|
|
||||||
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
|
|
||||||
}
|
|
||||||
return runtimeUrl;
|
|
||||||
}
|
|
||||||
static getCall(id_token_url) {
|
|
||||||
var _a;
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const httpclient = OidcClient.createHttpClient();
|
|
||||||
const res = yield httpclient
|
|
||||||
.getJson(id_token_url)
|
|
||||||
.catch(error => {
|
|
||||||
throw new Error(`Failed to get ID Token. \n
|
|
||||||
Error Code : ${error.statusCode}\n
|
|
||||||
Error Message: ${error.result.message}`);
|
|
||||||
});
|
|
||||||
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
|
||||||
if (!id_token) {
|
|
||||||
throw new Error('Response json body do not have ID Token field');
|
|
||||||
}
|
|
||||||
return id_token;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
static getIDToken(audience) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
|
||||||
// New ID Token is requested from action service
|
|
||||||
let id_token_url = OidcClient.getIDTokenUrl();
|
|
||||||
if (audience) {
|
|
||||||
const encodedAudience = encodeURIComponent(audience);
|
|
||||||
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
|
||||||
}
|
|
||||||
core_1.debug(`ID token url is ${id_token_url}`);
|
|
||||||
const id_token = yield OidcClient.getCall(id_token_url);
|
|
||||||
core_1.setSecret(id_token);
|
|
||||||
return id_token;
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
throw new Error(`Error message: ${error.message}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.OidcClient = OidcClient;
|
|
||||||
//# sourceMappingURL=oidc-utils.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"oidc-utils.js","sourceRoot":"","sources":["../src/oidc-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,sDAA+C;AAC/C,wDAAqE;AACrE,iCAAuC;AAKvC,MAAa,UAAU;IACb,MAAM,CAAC,gBAAgB,CAC7B,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,EAAE;QAEb,MAAM,cAAc,GAAmB;YACrC,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;SACrB,CAAA;QAED,OAAO,IAAI,wBAAU,CACnB,qBAAqB,EACrB,CAAC,IAAI,8BAAuB,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,EAC3D,cAAc,CACf,CAAA;IACH,CAAC;IAEO,MAAM,CAAC,eAAe;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;QAC3D,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAA;SACF;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAEO,MAAM,CAAC,aAAa;QAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;SAC3E;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,MAAM,CAAO,OAAO,CAAC,YAAoB;;;YAC/C,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAA;YAEhD,MAAM,GAAG,GAAG,MAAM,UAAU;iBACzB,OAAO,CAAgB,YAAY,CAAC;iBACpC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,MAAM,IAAI,KAAK,CACb;uBACa,KAAK,CAAC,UAAU;yBACd,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CACtC,CAAA;YACH,CAAC,CAAC,CAAA;YAEJ,MAAM,QAAQ,SAAG,GAAG,CAAC,MAAM,0CAAE,KAAK,CAAA;YAClC,IAAI,CAAC,QAAQ,EAAE;gBACb,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;aACjE;YACD,OAAO,QAAQ,CAAA;;KAChB;IAED,MAAM,CAAO,UAAU,CAAC,QAAiB;;YACvC,IAAI;gBACF,gDAAgD;gBAChD,IAAI,YAAY,GAAW,UAAU,CAAC,aAAa,EAAE,CAAA;gBACrD,IAAI,QAAQ,EAAE;oBACZ,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;oBACpD,YAAY,GAAG,GAAG,YAAY,aAAa,eAAe,EAAE,CAAA;iBAC7D;gBAED,YAAK,CAAC,mBAAmB,YAAY,EAAE,CAAC,CAAA;gBAExC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;gBACvD,gBAAS,CAAC,QAAQ,CAAC,CAAA;gBACnB,OAAO,QAAQ,CAAA;aAChB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;aACnD;QACH,CAAC;KAAA;CACF;AAzED,gCAyEC"}
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
|
|
||||||
* replaced with /.
|
|
||||||
*
|
|
||||||
* @param pth. Path to transform.
|
|
||||||
* @return string Posix path.
|
|
||||||
*/
|
|
||||||
export declare function toPosixPath(pth: string): string;
|
|
||||||
/**
|
|
||||||
* toWin32Path converts the given path to the win32 form. On Linux, / will be
|
|
||||||
* replaced with \\.
|
|
||||||
*
|
|
||||||
* @param pth. Path to transform.
|
|
||||||
* @return string Win32 path.
|
|
||||||
*/
|
|
||||||
export declare function toWin32Path(pth: string): string;
|
|
||||||
/**
|
|
||||||
* toPlatformPath converts the given path to a platform-specific path. It does
|
|
||||||
* this by replacing instances of / and \ with the platform-specific path
|
|
||||||
* separator.
|
|
||||||
*
|
|
||||||
* @param pth The path to platformize.
|
|
||||||
* @return string The platform-specific path.
|
|
||||||
*/
|
|
||||||
export declare function toPlatformPath(pth: string): string;
|
|
||||||
-58
@@ -1,58 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
|
|
||||||
const path = __importStar(require("path"));
|
|
||||||
/**
|
|
||||||
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
|
|
||||||
* replaced with /.
|
|
||||||
*
|
|
||||||
* @param pth. Path to transform.
|
|
||||||
* @return string Posix path.
|
|
||||||
*/
|
|
||||||
function toPosixPath(pth) {
|
|
||||||
return pth.replace(/[\\]/g, '/');
|
|
||||||
}
|
|
||||||
exports.toPosixPath = toPosixPath;
|
|
||||||
/**
|
|
||||||
* toWin32Path converts the given path to the win32 form. On Linux, / will be
|
|
||||||
* replaced with \\.
|
|
||||||
*
|
|
||||||
* @param pth. Path to transform.
|
|
||||||
* @return string Win32 path.
|
|
||||||
*/
|
|
||||||
function toWin32Path(pth) {
|
|
||||||
return pth.replace(/[/]/g, '\\');
|
|
||||||
}
|
|
||||||
exports.toWin32Path = toWin32Path;
|
|
||||||
/**
|
|
||||||
* toPlatformPath converts the given path to a platform-specific path. It does
|
|
||||||
* this by replacing instances of / and \ with the platform-specific path
|
|
||||||
* separator.
|
|
||||||
*
|
|
||||||
* @param pth The path to platformize.
|
|
||||||
* @return string The platform-specific path.
|
|
||||||
*/
|
|
||||||
function toPlatformPath(pth) {
|
|
||||||
return pth.replace(/[/\\]/g, path.sep);
|
|
||||||
}
|
|
||||||
exports.toPlatformPath = toPlatformPath;
|
|
||||||
//# sourceMappingURL=path-utils.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAE5B;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC;AAFD,kCAEC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,CAAC;AAFD,kCAEC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,wCAEC"}
|
|
||||||
-202
@@ -1,202 +0,0 @@
|
|||||||
export declare const SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
|
|
||||||
export declare const SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
|
|
||||||
export declare type SummaryTableRow = (SummaryTableCell | string)[];
|
|
||||||
export interface SummaryTableCell {
|
|
||||||
/**
|
|
||||||
* Cell content
|
|
||||||
*/
|
|
||||||
data: string;
|
|
||||||
/**
|
|
||||||
* Render cell as header
|
|
||||||
* (optional) default: false
|
|
||||||
*/
|
|
||||||
header?: boolean;
|
|
||||||
/**
|
|
||||||
* Number of columns the cell extends
|
|
||||||
* (optional) default: '1'
|
|
||||||
*/
|
|
||||||
colspan?: string;
|
|
||||||
/**
|
|
||||||
* Number of rows the cell extends
|
|
||||||
* (optional) default: '1'
|
|
||||||
*/
|
|
||||||
rowspan?: string;
|
|
||||||
}
|
|
||||||
export interface SummaryImageOptions {
|
|
||||||
/**
|
|
||||||
* The width of the image in pixels. Must be an integer without a unit.
|
|
||||||
* (optional)
|
|
||||||
*/
|
|
||||||
width?: string;
|
|
||||||
/**
|
|
||||||
* The height of the image in pixels. Must be an integer without a unit.
|
|
||||||
* (optional)
|
|
||||||
*/
|
|
||||||
height?: string;
|
|
||||||
}
|
|
||||||
export interface SummaryWriteOptions {
|
|
||||||
/**
|
|
||||||
* Replace all existing content in summary file with buffer contents
|
|
||||||
* (optional) default: false
|
|
||||||
*/
|
|
||||||
overwrite?: boolean;
|
|
||||||
}
|
|
||||||
declare class Summary {
|
|
||||||
private _buffer;
|
|
||||||
private _filePath?;
|
|
||||||
constructor();
|
|
||||||
/**
|
|
||||||
* Finds the summary file path from the environment, rejects if env var is not found or file does not exist
|
|
||||||
* Also checks r/w permissions.
|
|
||||||
*
|
|
||||||
* @returns step summary file path
|
|
||||||
*/
|
|
||||||
private filePath;
|
|
||||||
/**
|
|
||||||
* Wraps content in an HTML tag, adding any HTML attributes
|
|
||||||
*
|
|
||||||
* @param {string} tag HTML tag to wrap
|
|
||||||
* @param {string | null} content content within the tag
|
|
||||||
* @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
|
|
||||||
*
|
|
||||||
* @returns {string} content wrapped in HTML element
|
|
||||||
*/
|
|
||||||
private wrap;
|
|
||||||
/**
|
|
||||||
* Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
|
|
||||||
*
|
|
||||||
* @param {SummaryWriteOptions} [options] (optional) options for write operation
|
|
||||||
*
|
|
||||||
* @returns {Promise<Summary>} summary instance
|
|
||||||
*/
|
|
||||||
write(options?: SummaryWriteOptions): Promise<Summary>;
|
|
||||||
/**
|
|
||||||
* Clears the summary buffer and wipes the summary file
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
clear(): Promise<Summary>;
|
|
||||||
/**
|
|
||||||
* Returns the current summary buffer as a string
|
|
||||||
*
|
|
||||||
* @returns {string} string of summary buffer
|
|
||||||
*/
|
|
||||||
stringify(): string;
|
|
||||||
/**
|
|
||||||
* If the summary buffer is empty
|
|
||||||
*
|
|
||||||
* @returns {boolen} true if the buffer is empty
|
|
||||||
*/
|
|
||||||
isEmptyBuffer(): boolean;
|
|
||||||
/**
|
|
||||||
* Resets the summary buffer without writing to summary file
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
emptyBuffer(): Summary;
|
|
||||||
/**
|
|
||||||
* Adds raw text to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} text content to add
|
|
||||||
* @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addRaw(text: string, addEOL?: boolean): Summary;
|
|
||||||
/**
|
|
||||||
* Adds the operating system-specific end-of-line marker to the buffer
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addEOL(): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML codeblock to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} code content to render within fenced code block
|
|
||||||
* @param {string} lang (optional) language to syntax highlight code
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addCodeBlock(code: string, lang?: string): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML list to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string[]} items list of items to render
|
|
||||||
* @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addList(items: string[], ordered?: boolean): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML table to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {SummaryTableCell[]} rows table rows
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addTable(rows: SummaryTableRow[]): Summary;
|
|
||||||
/**
|
|
||||||
* Adds a collapsable HTML details element to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} label text for the closed state
|
|
||||||
* @param {string} content collapsable content
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addDetails(label: string, content: string): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML image tag to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} src path to the image you to embed
|
|
||||||
* @param {string} alt text description of the image
|
|
||||||
* @param {SummaryImageOptions} options (optional) addition image attributes
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addImage(src: string, alt: string, options?: SummaryImageOptions): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML section heading element
|
|
||||||
*
|
|
||||||
* @param {string} text heading text
|
|
||||||
* @param {number | string} [level=1] (optional) the heading level, default: 1
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addHeading(text: string, level?: number | string): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML thematic break (<hr>) to the summary buffer
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addSeparator(): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML line break (<br>) to the summary buffer
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addBreak(): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML blockquote to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} text quote text
|
|
||||||
* @param {string} cite (optional) citation url
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addQuote(text: string, cite?: string): Summary;
|
|
||||||
/**
|
|
||||||
* Adds an HTML anchor tag to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} text link text/content
|
|
||||||
* @param {string} href hyperlink
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addLink(text: string, href: string): Summary;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @deprecated use `core.summary`
|
|
||||||
*/
|
|
||||||
export declare const markdownSummary: Summary;
|
|
||||||
export declare const summary: Summary;
|
|
||||||
export {};
|
|
||||||
-283
@@ -1,283 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
|
|
||||||
const os_1 = require("os");
|
|
||||||
const fs_1 = require("fs");
|
|
||||||
const { access, appendFile, writeFile } = fs_1.promises;
|
|
||||||
exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
|
|
||||||
exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
|
|
||||||
class Summary {
|
|
||||||
constructor() {
|
|
||||||
this._buffer = '';
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Finds the summary file path from the environment, rejects if env var is not found or file does not exist
|
|
||||||
* Also checks r/w permissions.
|
|
||||||
*
|
|
||||||
* @returns step summary file path
|
|
||||||
*/
|
|
||||||
filePath() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (this._filePath) {
|
|
||||||
return this._filePath;
|
|
||||||
}
|
|
||||||
const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
|
|
||||||
if (!pathFromEnv) {
|
|
||||||
throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
|
|
||||||
}
|
|
||||||
catch (_a) {
|
|
||||||
throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
|
|
||||||
}
|
|
||||||
this._filePath = pathFromEnv;
|
|
||||||
return this._filePath;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Wraps content in an HTML tag, adding any HTML attributes
|
|
||||||
*
|
|
||||||
* @param {string} tag HTML tag to wrap
|
|
||||||
* @param {string | null} content content within the tag
|
|
||||||
* @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
|
|
||||||
*
|
|
||||||
* @returns {string} content wrapped in HTML element
|
|
||||||
*/
|
|
||||||
wrap(tag, content, attrs = {}) {
|
|
||||||
const htmlAttrs = Object.entries(attrs)
|
|
||||||
.map(([key, value]) => ` ${key}="${value}"`)
|
|
||||||
.join('');
|
|
||||||
if (!content) {
|
|
||||||
return `<${tag}${htmlAttrs}>`;
|
|
||||||
}
|
|
||||||
return `<${tag}${htmlAttrs}>${content}</${tag}>`;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
|
|
||||||
*
|
|
||||||
* @param {SummaryWriteOptions} [options] (optional) options for write operation
|
|
||||||
*
|
|
||||||
* @returns {Promise<Summary>} summary instance
|
|
||||||
*/
|
|
||||||
write(options) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
|
|
||||||
const filePath = yield this.filePath();
|
|
||||||
const writeFunc = overwrite ? writeFile : appendFile;
|
|
||||||
yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
|
|
||||||
return this.emptyBuffer();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Clears the summary buffer and wipes the summary file
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
clear() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.emptyBuffer().write({ overwrite: true });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the current summary buffer as a string
|
|
||||||
*
|
|
||||||
* @returns {string} string of summary buffer
|
|
||||||
*/
|
|
||||||
stringify() {
|
|
||||||
return this._buffer;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* If the summary buffer is empty
|
|
||||||
*
|
|
||||||
* @returns {boolen} true if the buffer is empty
|
|
||||||
*/
|
|
||||||
isEmptyBuffer() {
|
|
||||||
return this._buffer.length === 0;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Resets the summary buffer without writing to summary file
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
emptyBuffer() {
|
|
||||||
this._buffer = '';
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds raw text to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} text content to add
|
|
||||||
* @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addRaw(text, addEOL = false) {
|
|
||||||
this._buffer += text;
|
|
||||||
return addEOL ? this.addEOL() : this;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds the operating system-specific end-of-line marker to the buffer
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addEOL() {
|
|
||||||
return this.addRaw(os_1.EOL);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML codeblock to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} code content to render within fenced code block
|
|
||||||
* @param {string} lang (optional) language to syntax highlight code
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addCodeBlock(code, lang) {
|
|
||||||
const attrs = Object.assign({}, (lang && { lang }));
|
|
||||||
const element = this.wrap('pre', this.wrap('code', code), attrs);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML list to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string[]} items list of items to render
|
|
||||||
* @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addList(items, ordered = false) {
|
|
||||||
const tag = ordered ? 'ol' : 'ul';
|
|
||||||
const listItems = items.map(item => this.wrap('li', item)).join('');
|
|
||||||
const element = this.wrap(tag, listItems);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML table to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {SummaryTableCell[]} rows table rows
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addTable(rows) {
|
|
||||||
const tableBody = rows
|
|
||||||
.map(row => {
|
|
||||||
const cells = row
|
|
||||||
.map(cell => {
|
|
||||||
if (typeof cell === 'string') {
|
|
||||||
return this.wrap('td', cell);
|
|
||||||
}
|
|
||||||
const { header, data, colspan, rowspan } = cell;
|
|
||||||
const tag = header ? 'th' : 'td';
|
|
||||||
const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
|
|
||||||
return this.wrap(tag, data, attrs);
|
|
||||||
})
|
|
||||||
.join('');
|
|
||||||
return this.wrap('tr', cells);
|
|
||||||
})
|
|
||||||
.join('');
|
|
||||||
const element = this.wrap('table', tableBody);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds a collapsable HTML details element to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} label text for the closed state
|
|
||||||
* @param {string} content collapsable content
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addDetails(label, content) {
|
|
||||||
const element = this.wrap('details', this.wrap('summary', label) + content);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML image tag to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} src path to the image you to embed
|
|
||||||
* @param {string} alt text description of the image
|
|
||||||
* @param {SummaryImageOptions} options (optional) addition image attributes
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addImage(src, alt, options) {
|
|
||||||
const { width, height } = options || {};
|
|
||||||
const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
|
|
||||||
const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML section heading element
|
|
||||||
*
|
|
||||||
* @param {string} text heading text
|
|
||||||
* @param {number | string} [level=1] (optional) the heading level, default: 1
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addHeading(text, level) {
|
|
||||||
const tag = `h${level}`;
|
|
||||||
const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
|
|
||||||
? tag
|
|
||||||
: 'h1';
|
|
||||||
const element = this.wrap(allowedTag, text);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML thematic break (<hr>) to the summary buffer
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addSeparator() {
|
|
||||||
const element = this.wrap('hr', null);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML line break (<br>) to the summary buffer
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addBreak() {
|
|
||||||
const element = this.wrap('br', null);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML blockquote to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} text quote text
|
|
||||||
* @param {string} cite (optional) citation url
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addQuote(text, cite) {
|
|
||||||
const attrs = Object.assign({}, (cite && { cite }));
|
|
||||||
const element = this.wrap('blockquote', text, attrs);
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds an HTML anchor tag to the summary buffer
|
|
||||||
*
|
|
||||||
* @param {string} text link text/content
|
|
||||||
* @param {string} href hyperlink
|
|
||||||
*
|
|
||||||
* @returns {Summary} summary instance
|
|
||||||
*/
|
|
||||||
addLink(text, href) {
|
|
||||||
const element = this.wrap('a', text, { href });
|
|
||||||
return this.addRaw(element).addEOL();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const _summary = new Summary();
|
|
||||||
/**
|
|
||||||
* @deprecated use `core.summary`
|
|
||||||
*/
|
|
||||||
exports.markdownSummary = _summary;
|
|
||||||
exports.summary = _summary;
|
|
||||||
//# sourceMappingURL=summary.js.map
|
|
||||||
-1
File diff suppressed because one or more lines are too long
-14
@@ -1,14 +0,0 @@
|
|||||||
import { AnnotationProperties } from './core';
|
|
||||||
import { CommandProperties } from './command';
|
|
||||||
/**
|
|
||||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
|
||||||
* @param input input to sanitize into a string
|
|
||||||
*/
|
|
||||||
export declare function toCommandValue(input: any): string;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param annotationProperties
|
|
||||||
* @returns The command properties to send with the actual annotation command
|
|
||||||
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
|
||||||
*/
|
|
||||||
export declare function toCommandProperties(annotationProperties: AnnotationProperties): CommandProperties;
|
|
||||||
-40
@@ -1,40 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
// We use any as a valid input type
|
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.toCommandProperties = exports.toCommandValue = void 0;
|
|
||||||
/**
|
|
||||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
|
||||||
* @param input input to sanitize into a string
|
|
||||||
*/
|
|
||||||
function toCommandValue(input) {
|
|
||||||
if (input === null || input === undefined) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
else if (typeof input === 'string' || input instanceof String) {
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
return JSON.stringify(input);
|
|
||||||
}
|
|
||||||
exports.toCommandValue = toCommandValue;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param annotationProperties
|
|
||||||
* @returns The command properties to send with the actual annotation command
|
|
||||||
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
|
|
||||||
*/
|
|
||||||
function toCommandProperties(annotationProperties) {
|
|
||||||
if (!Object.keys(annotationProperties).length) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
title: annotationProperties.title,
|
|
||||||
file: annotationProperties.file,
|
|
||||||
line: annotationProperties.startLine,
|
|
||||||
endLine: annotationProperties.endLine,
|
|
||||||
col: annotationProperties.startColumn,
|
|
||||||
endColumn: annotationProperties.endColumn
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.toCommandProperties = toCommandProperties;
|
|
||||||
//# sourceMappingURL=utils.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;;AAKvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,oBAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE;QAC7C,OAAO,EAAE,CAAA;KACV;IAED,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,KAAK;QACjC,IAAI,EAAE,oBAAoB,CAAC,IAAI;QAC/B,IAAI,EAAE,oBAAoB,CAAC,SAAS;QACpC,OAAO,EAAE,oBAAoB,CAAC,OAAO;QACrC,GAAG,EAAE,oBAAoB,CAAC,WAAW;QACrC,SAAS,EAAE,oBAAoB,CAAC,SAAS;KAC1C,CAAA;AACH,CAAC;AAfD,kDAeC"}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
Actions Http Client for Node.js
|
|
||||||
|
|
||||||
Copyright (c) GitHub, Inc.
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
||||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
||||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
-73
@@ -1,73 +0,0 @@
|
|||||||
# `@actions/http-client`
|
|
||||||
|
|
||||||
A lightweight HTTP client optimized for building actions.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- HTTP client with TypeScript generics and async/await/Promises
|
|
||||||
- Typings included!
|
|
||||||
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
|
||||||
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
|
||||||
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
|
||||||
- Redirects supported
|
|
||||||
|
|
||||||
Features and releases [here](./RELEASES.md)
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
```
|
|
||||||
npm install @actions/http-client --save
|
|
||||||
```
|
|
||||||
|
|
||||||
## Samples
|
|
||||||
|
|
||||||
See the [tests](./__tests__) for detailed examples.
|
|
||||||
|
|
||||||
## Errors
|
|
||||||
|
|
||||||
### HTTP
|
|
||||||
|
|
||||||
The HTTP client does not throw unless truly exceptional.
|
|
||||||
|
|
||||||
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
|
||||||
* Redirects (3xx) will be followed by default.
|
|
||||||
|
|
||||||
See the [tests](./__tests__) for detailed examples.
|
|
||||||
|
|
||||||
## Debugging
|
|
||||||
|
|
||||||
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
export NODE_DEBUG=http
|
|
||||||
```
|
|
||||||
|
|
||||||
## Node support
|
|
||||||
|
|
||||||
The http-client is built using the latest LTS version of Node 12. It may work on previous node LTS versions but it's tested and officially supported on Node12+.
|
|
||||||
|
|
||||||
## Support and Versioning
|
|
||||||
|
|
||||||
We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat).
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
We welcome PRs. Please create an issue and if applicable, a design before proceeding with code.
|
|
||||||
|
|
||||||
once:
|
|
||||||
|
|
||||||
```
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
To build:
|
|
||||||
|
|
||||||
```
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
To run all tests:
|
|
||||||
|
|
||||||
```
|
|
||||||
npm test
|
|
||||||
```
|
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
/// <reference types="node" />
|
|
||||||
import * as http from 'http';
|
|
||||||
import * as ifm from './interfaces';
|
|
||||||
import { HttpClientResponse } from './index';
|
|
||||||
export declare class BasicCredentialHandler implements ifm.RequestHandler {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
constructor(username: string, password: string);
|
|
||||||
prepareRequest(options: http.RequestOptions): void;
|
|
||||||
canHandleAuthentication(): boolean;
|
|
||||||
handleAuthentication(): Promise<HttpClientResponse>;
|
|
||||||
}
|
|
||||||
export declare class BearerCredentialHandler implements ifm.RequestHandler {
|
|
||||||
token: string;
|
|
||||||
constructor(token: string);
|
|
||||||
prepareRequest(options: http.RequestOptions): void;
|
|
||||||
canHandleAuthentication(): boolean;
|
|
||||||
handleAuthentication(): Promise<HttpClientResponse>;
|
|
||||||
}
|
|
||||||
export declare class PersonalAccessTokenCredentialHandler implements ifm.RequestHandler {
|
|
||||||
token: string;
|
|
||||||
constructor(token: string);
|
|
||||||
prepareRequest(options: http.RequestOptions): void;
|
|
||||||
canHandleAuthentication(): boolean;
|
|
||||||
handleAuthentication(): Promise<HttpClientResponse>;
|
|
||||||
}
|
|
||||||
-81
@@ -1,81 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
|
|
||||||
class BasicCredentialHandler {
|
|
||||||
constructor(username, password) {
|
|
||||||
this.username = username;
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
prepareRequest(options) {
|
|
||||||
if (!options.headers) {
|
|
||||||
throw Error('The request has no headers');
|
|
||||||
}
|
|
||||||
options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
|
|
||||||
}
|
|
||||||
// This handler cannot handle 401
|
|
||||||
canHandleAuthentication() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
handleAuthentication() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
throw new Error('not implemented');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.BasicCredentialHandler = BasicCredentialHandler;
|
|
||||||
class BearerCredentialHandler {
|
|
||||||
constructor(token) {
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
// currently implements pre-authorization
|
|
||||||
// TODO: support preAuth = false where it hooks on 401
|
|
||||||
prepareRequest(options) {
|
|
||||||
if (!options.headers) {
|
|
||||||
throw Error('The request has no headers');
|
|
||||||
}
|
|
||||||
options.headers['Authorization'] = `Bearer ${this.token}`;
|
|
||||||
}
|
|
||||||
// This handler cannot handle 401
|
|
||||||
canHandleAuthentication() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
handleAuthentication() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
throw new Error('not implemented');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.BearerCredentialHandler = BearerCredentialHandler;
|
|
||||||
class PersonalAccessTokenCredentialHandler {
|
|
||||||
constructor(token) {
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
// currently implements pre-authorization
|
|
||||||
// TODO: support preAuth = false where it hooks on 401
|
|
||||||
prepareRequest(options) {
|
|
||||||
if (!options.headers) {
|
|
||||||
throw Error('The request has no headers');
|
|
||||||
}
|
|
||||||
options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
|
|
||||||
}
|
|
||||||
// This handler cannot handle 401
|
|
||||||
canHandleAuthentication() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
handleAuthentication() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
throw new Error('not implemented');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
|
||||||
//# sourceMappingURL=auth.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,sBAAsB;IAIjC,YAAY,QAAgB,EAAE,QAAgB;QAC5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC1C;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CACpC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AA1BD,wDA0BC;AAED,MAAa,uBAAuB;IAGlC,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC1C;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAA;IAC3D,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AAxBD,0DAwBC;AAED,MAAa,oCAAoC;IAI/C,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC1C;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,OAAO,IAAI,CAAC,KAAK,EAAE,CACpB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AA3BD,oFA2BC"}
|
|
||||||
-123
@@ -1,123 +0,0 @@
|
|||||||
/// <reference types="node" />
|
|
||||||
import * as http from 'http';
|
|
||||||
import * as ifm from './interfaces';
|
|
||||||
export declare enum HttpCodes {
|
|
||||||
OK = 200,
|
|
||||||
MultipleChoices = 300,
|
|
||||||
MovedPermanently = 301,
|
|
||||||
ResourceMoved = 302,
|
|
||||||
SeeOther = 303,
|
|
||||||
NotModified = 304,
|
|
||||||
UseProxy = 305,
|
|
||||||
SwitchProxy = 306,
|
|
||||||
TemporaryRedirect = 307,
|
|
||||||
PermanentRedirect = 308,
|
|
||||||
BadRequest = 400,
|
|
||||||
Unauthorized = 401,
|
|
||||||
PaymentRequired = 402,
|
|
||||||
Forbidden = 403,
|
|
||||||
NotFound = 404,
|
|
||||||
MethodNotAllowed = 405,
|
|
||||||
NotAcceptable = 406,
|
|
||||||
ProxyAuthenticationRequired = 407,
|
|
||||||
RequestTimeout = 408,
|
|
||||||
Conflict = 409,
|
|
||||||
Gone = 410,
|
|
||||||
TooManyRequests = 429,
|
|
||||||
InternalServerError = 500,
|
|
||||||
NotImplemented = 501,
|
|
||||||
BadGateway = 502,
|
|
||||||
ServiceUnavailable = 503,
|
|
||||||
GatewayTimeout = 504
|
|
||||||
}
|
|
||||||
export declare enum Headers {
|
|
||||||
Accept = "accept",
|
|
||||||
ContentType = "content-type"
|
|
||||||
}
|
|
||||||
export declare enum MediaTypes {
|
|
||||||
ApplicationJson = "application/json"
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
|
||||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|
||||||
*/
|
|
||||||
export declare function getProxyUrl(serverUrl: string): string;
|
|
||||||
export declare class HttpClientError extends Error {
|
|
||||||
constructor(message: string, statusCode: number);
|
|
||||||
statusCode: number;
|
|
||||||
result?: any;
|
|
||||||
}
|
|
||||||
export declare class HttpClientResponse {
|
|
||||||
constructor(message: http.IncomingMessage);
|
|
||||||
message: http.IncomingMessage;
|
|
||||||
readBody(): Promise<string>;
|
|
||||||
}
|
|
||||||
export declare function isHttps(requestUrl: string): boolean;
|
|
||||||
export declare class HttpClient {
|
|
||||||
userAgent: string | undefined;
|
|
||||||
handlers: ifm.RequestHandler[];
|
|
||||||
requestOptions: ifm.RequestOptions | undefined;
|
|
||||||
private _ignoreSslError;
|
|
||||||
private _socketTimeout;
|
|
||||||
private _allowRedirects;
|
|
||||||
private _allowRedirectDowngrade;
|
|
||||||
private _maxRedirects;
|
|
||||||
private _allowRetries;
|
|
||||||
private _maxRetries;
|
|
||||||
private _agent;
|
|
||||||
private _proxyAgent;
|
|
||||||
private _keepAlive;
|
|
||||||
private _disposed;
|
|
||||||
constructor(userAgent?: string, handlers?: ifm.RequestHandler[], requestOptions?: ifm.RequestOptions);
|
|
||||||
options(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
get(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
del(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
post(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
patch(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
put(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
head(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
/**
|
|
||||||
* Gets a typed object from an endpoint
|
|
||||||
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
|
||||||
*/
|
|
||||||
getJson<T>(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
|
||||||
postJson<T>(requestUrl: string, obj: any, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
|
||||||
putJson<T>(requestUrl: string, obj: any, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
|
||||||
patchJson<T>(requestUrl: string, obj: any, additionalHeaders?: http.OutgoingHttpHeaders): Promise<ifm.TypedResponse<T>>;
|
|
||||||
/**
|
|
||||||
* Makes a raw http request.
|
|
||||||
* All other methods such as get, post, patch, and request ultimately call this.
|
|
||||||
* Prefer get, del, post and patch
|
|
||||||
*/
|
|
||||||
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream | null, headers?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
/**
|
|
||||||
* Needs to be called if keepAlive is set to true in request options.
|
|
||||||
*/
|
|
||||||
dispose(): void;
|
|
||||||
/**
|
|
||||||
* Raw request.
|
|
||||||
* @param info
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
requestRaw(info: ifm.RequestInfo, data: string | NodeJS.ReadableStream | null): Promise<HttpClientResponse>;
|
|
||||||
/**
|
|
||||||
* Raw request with callback.
|
|
||||||
* @param info
|
|
||||||
* @param data
|
|
||||||
* @param onResult
|
|
||||||
*/
|
|
||||||
requestRawWithCallback(info: ifm.RequestInfo, data: string | NodeJS.ReadableStream | null, onResult: (err?: Error, res?: HttpClientResponse) => void): void;
|
|
||||||
/**
|
|
||||||
* Gets an http agent. This function is useful when you need an http agent that handles
|
|
||||||
* routing through a proxy server - depending upon the url and proxy environment variables.
|
|
||||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|
||||||
*/
|
|
||||||
getAgent(serverUrl: string): http.Agent;
|
|
||||||
private _prepareRequest;
|
|
||||||
private _mergeHeaders;
|
|
||||||
private _getExistingOrDefaultHeader;
|
|
||||||
private _getAgent;
|
|
||||||
private _performExponentialBackoff;
|
|
||||||
private _processResponse;
|
|
||||||
}
|
|
||||||
-605
@@ -1,605 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
|
|
||||||
const http = __importStar(require("http"));
|
|
||||||
const https = __importStar(require("https"));
|
|
||||||
const pm = __importStar(require("./proxy"));
|
|
||||||
const tunnel = __importStar(require("tunnel"));
|
|
||||||
var HttpCodes;
|
|
||||||
(function (HttpCodes) {
|
|
||||||
HttpCodes[HttpCodes["OK"] = 200] = "OK";
|
|
||||||
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
|
|
||||||
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
|
|
||||||
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
|
|
||||||
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
|
|
||||||
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
|
|
||||||
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
|
|
||||||
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
|
|
||||||
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
|
||||||
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
|
|
||||||
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
|
|
||||||
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
|
|
||||||
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
|
|
||||||
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
|
|
||||||
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
|
|
||||||
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
|
||||||
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
|
|
||||||
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
|
||||||
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
|
||||||
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
|
||||||
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
|
||||||
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
|
|
||||||
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
|
||||||
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
|
||||||
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
|
||||||
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
|
||||||
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
||||||
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
|
||||||
var Headers;
|
|
||||||
(function (Headers) {
|
|
||||||
Headers["Accept"] = "accept";
|
|
||||||
Headers["ContentType"] = "content-type";
|
|
||||||
})(Headers = exports.Headers || (exports.Headers = {}));
|
|
||||||
var MediaTypes;
|
|
||||||
(function (MediaTypes) {
|
|
||||||
MediaTypes["ApplicationJson"] = "application/json";
|
|
||||||
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
|
|
||||||
/**
|
|
||||||
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
|
||||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|
||||||
*/
|
|
||||||
function getProxyUrl(serverUrl) {
|
|
||||||
const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
|
|
||||||
return proxyUrl ? proxyUrl.href : '';
|
|
||||||
}
|
|
||||||
exports.getProxyUrl = getProxyUrl;
|
|
||||||
const HttpRedirectCodes = [
|
|
||||||
HttpCodes.MovedPermanently,
|
|
||||||
HttpCodes.ResourceMoved,
|
|
||||||
HttpCodes.SeeOther,
|
|
||||||
HttpCodes.TemporaryRedirect,
|
|
||||||
HttpCodes.PermanentRedirect
|
|
||||||
];
|
|
||||||
const HttpResponseRetryCodes = [
|
|
||||||
HttpCodes.BadGateway,
|
|
||||||
HttpCodes.ServiceUnavailable,
|
|
||||||
HttpCodes.GatewayTimeout
|
|
||||||
];
|
|
||||||
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
|
||||||
const ExponentialBackoffCeiling = 10;
|
|
||||||
const ExponentialBackoffTimeSlice = 5;
|
|
||||||
class HttpClientError extends Error {
|
|
||||||
constructor(message, statusCode) {
|
|
||||||
super(message);
|
|
||||||
this.name = 'HttpClientError';
|
|
||||||
this.statusCode = statusCode;
|
|
||||||
Object.setPrototypeOf(this, HttpClientError.prototype);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.HttpClientError = HttpClientError;
|
|
||||||
class HttpClientResponse {
|
|
||||||
constructor(message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
readBody() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let output = Buffer.alloc(0);
|
|
||||||
this.message.on('data', (chunk) => {
|
|
||||||
output = Buffer.concat([output, chunk]);
|
|
||||||
});
|
|
||||||
this.message.on('end', () => {
|
|
||||||
resolve(output.toString());
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.HttpClientResponse = HttpClientResponse;
|
|
||||||
function isHttps(requestUrl) {
|
|
||||||
const parsedUrl = new URL(requestUrl);
|
|
||||||
return parsedUrl.protocol === 'https:';
|
|
||||||
}
|
|
||||||
exports.isHttps = isHttps;
|
|
||||||
class HttpClient {
|
|
||||||
constructor(userAgent, handlers, requestOptions) {
|
|
||||||
this._ignoreSslError = false;
|
|
||||||
this._allowRedirects = true;
|
|
||||||
this._allowRedirectDowngrade = false;
|
|
||||||
this._maxRedirects = 50;
|
|
||||||
this._allowRetries = false;
|
|
||||||
this._maxRetries = 1;
|
|
||||||
this._keepAlive = false;
|
|
||||||
this._disposed = false;
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
this.handlers = handlers || [];
|
|
||||||
this.requestOptions = requestOptions;
|
|
||||||
if (requestOptions) {
|
|
||||||
if (requestOptions.ignoreSslError != null) {
|
|
||||||
this._ignoreSslError = requestOptions.ignoreSslError;
|
|
||||||
}
|
|
||||||
this._socketTimeout = requestOptions.socketTimeout;
|
|
||||||
if (requestOptions.allowRedirects != null) {
|
|
||||||
this._allowRedirects = requestOptions.allowRedirects;
|
|
||||||
}
|
|
||||||
if (requestOptions.allowRedirectDowngrade != null) {
|
|
||||||
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
|
||||||
}
|
|
||||||
if (requestOptions.maxRedirects != null) {
|
|
||||||
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
|
||||||
}
|
|
||||||
if (requestOptions.keepAlive != null) {
|
|
||||||
this._keepAlive = requestOptions.keepAlive;
|
|
||||||
}
|
|
||||||
if (requestOptions.allowRetries != null) {
|
|
||||||
this._allowRetries = requestOptions.allowRetries;
|
|
||||||
}
|
|
||||||
if (requestOptions.maxRetries != null) {
|
|
||||||
this._maxRetries = requestOptions.maxRetries;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
options(requestUrl, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
get(requestUrl, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('GET', requestUrl, null, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
del(requestUrl, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
post(requestUrl, data, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('POST', requestUrl, data, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
patch(requestUrl, data, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
put(requestUrl, data, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('PUT', requestUrl, data, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
head(requestUrl, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return this.request(verb, requestUrl, stream, additionalHeaders);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Gets a typed object from an endpoint
|
|
||||||
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
|
||||||
*/
|
|
||||||
getJson(requestUrl, additionalHeaders = {}) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
||||||
const res = yield this.get(requestUrl, additionalHeaders);
|
|
||||||
return this._processResponse(res, this.requestOptions);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
postJson(requestUrl, obj, additionalHeaders = {}) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const data = JSON.stringify(obj, null, 2);
|
|
||||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
||||||
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
||||||
const res = yield this.post(requestUrl, data, additionalHeaders);
|
|
||||||
return this._processResponse(res, this.requestOptions);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
putJson(requestUrl, obj, additionalHeaders = {}) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const data = JSON.stringify(obj, null, 2);
|
|
||||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
||||||
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
||||||
const res = yield this.put(requestUrl, data, additionalHeaders);
|
|
||||||
return this._processResponse(res, this.requestOptions);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
patchJson(requestUrl, obj, additionalHeaders = {}) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const data = JSON.stringify(obj, null, 2);
|
|
||||||
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
||||||
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
||||||
const res = yield this.patch(requestUrl, data, additionalHeaders);
|
|
||||||
return this._processResponse(res, this.requestOptions);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Makes a raw http request.
|
|
||||||
* All other methods such as get, post, patch, and request ultimately call this.
|
|
||||||
* Prefer get, del, post and patch
|
|
||||||
*/
|
|
||||||
request(verb, requestUrl, data, headers) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (this._disposed) {
|
|
||||||
throw new Error('Client has already been disposed.');
|
|
||||||
}
|
|
||||||
const parsedUrl = new URL(requestUrl);
|
|
||||||
let info = this._prepareRequest(verb, parsedUrl, headers);
|
|
||||||
// Only perform retries on reads since writes may not be idempotent.
|
|
||||||
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
|
|
||||||
? this._maxRetries + 1
|
|
||||||
: 1;
|
|
||||||
let numTries = 0;
|
|
||||||
let response;
|
|
||||||
do {
|
|
||||||
response = yield this.requestRaw(info, data);
|
|
||||||
// Check if it's an authentication challenge
|
|
||||||
if (response &&
|
|
||||||
response.message &&
|
|
||||||
response.message.statusCode === HttpCodes.Unauthorized) {
|
|
||||||
let authenticationHandler;
|
|
||||||
for (const handler of this.handlers) {
|
|
||||||
if (handler.canHandleAuthentication(response)) {
|
|
||||||
authenticationHandler = handler;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (authenticationHandler) {
|
|
||||||
return authenticationHandler.handleAuthentication(this, info, data);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// We have received an unauthorized response but have no handlers to handle it.
|
|
||||||
// Let the response return to the caller.
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let redirectsRemaining = this._maxRedirects;
|
|
||||||
while (response.message.statusCode &&
|
|
||||||
HttpRedirectCodes.includes(response.message.statusCode) &&
|
|
||||||
this._allowRedirects &&
|
|
||||||
redirectsRemaining > 0) {
|
|
||||||
const redirectUrl = response.message.headers['location'];
|
|
||||||
if (!redirectUrl) {
|
|
||||||
// if there's no location to redirect to, we won't
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
const parsedRedirectUrl = new URL(redirectUrl);
|
|
||||||
if (parsedUrl.protocol === 'https:' &&
|
|
||||||
parsedUrl.protocol !== parsedRedirectUrl.protocol &&
|
|
||||||
!this._allowRedirectDowngrade) {
|
|
||||||
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
|
|
||||||
}
|
|
||||||
// we need to finish reading the response before reassigning response
|
|
||||||
// which will leak the open socket.
|
|
||||||
yield response.readBody();
|
|
||||||
// strip authorization header if redirected to a different hostname
|
|
||||||
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
|
|
||||||
for (const header in headers) {
|
|
||||||
// header names are case insensitive
|
|
||||||
if (header.toLowerCase() === 'authorization') {
|
|
||||||
delete headers[header];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// let's make the request with the new redirectUrl
|
|
||||||
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
|
||||||
response = yield this.requestRaw(info, data);
|
|
||||||
redirectsRemaining--;
|
|
||||||
}
|
|
||||||
if (!response.message.statusCode ||
|
|
||||||
!HttpResponseRetryCodes.includes(response.message.statusCode)) {
|
|
||||||
// If not a retry code, return immediately instead of retrying
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
numTries += 1;
|
|
||||||
if (numTries < maxTries) {
|
|
||||||
yield response.readBody();
|
|
||||||
yield this._performExponentialBackoff(numTries);
|
|
||||||
}
|
|
||||||
} while (numTries < maxTries);
|
|
||||||
return response;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Needs to be called if keepAlive is set to true in request options.
|
|
||||||
*/
|
|
||||||
dispose() {
|
|
||||||
if (this._agent) {
|
|
||||||
this._agent.destroy();
|
|
||||||
}
|
|
||||||
this._disposed = true;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Raw request.
|
|
||||||
* @param info
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
requestRaw(info, data) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
function callbackForResult(err, res) {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
else if (!res) {
|
|
||||||
// If `err` is not passed, then `res` must be passed.
|
|
||||||
reject(new Error('Unknown error'));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve(res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.requestRawWithCallback(info, data, callbackForResult);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Raw request with callback.
|
|
||||||
* @param info
|
|
||||||
* @param data
|
|
||||||
* @param onResult
|
|
||||||
*/
|
|
||||||
requestRawWithCallback(info, data, onResult) {
|
|
||||||
if (typeof data === 'string') {
|
|
||||||
if (!info.options.headers) {
|
|
||||||
info.options.headers = {};
|
|
||||||
}
|
|
||||||
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
|
|
||||||
}
|
|
||||||
let callbackCalled = false;
|
|
||||||
function handleResult(err, res) {
|
|
||||||
if (!callbackCalled) {
|
|
||||||
callbackCalled = true;
|
|
||||||
onResult(err, res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const req = info.httpModule.request(info.options, (msg) => {
|
|
||||||
const res = new HttpClientResponse(msg);
|
|
||||||
handleResult(undefined, res);
|
|
||||||
});
|
|
||||||
let socket;
|
|
||||||
req.on('socket', sock => {
|
|
||||||
socket = sock;
|
|
||||||
});
|
|
||||||
// If we ever get disconnected, we want the socket to timeout eventually
|
|
||||||
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
|
|
||||||
if (socket) {
|
|
||||||
socket.end();
|
|
||||||
}
|
|
||||||
handleResult(new Error(`Request timeout: ${info.options.path}`));
|
|
||||||
});
|
|
||||||
req.on('error', function (err) {
|
|
||||||
// err has statusCode property
|
|
||||||
// res should have headers
|
|
||||||
handleResult(err);
|
|
||||||
});
|
|
||||||
if (data && typeof data === 'string') {
|
|
||||||
req.write(data, 'utf8');
|
|
||||||
}
|
|
||||||
if (data && typeof data !== 'string') {
|
|
||||||
data.on('close', function () {
|
|
||||||
req.end();
|
|
||||||
});
|
|
||||||
data.pipe(req);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
req.end();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Gets an http agent. This function is useful when you need an http agent that handles
|
|
||||||
* routing through a proxy server - depending upon the url and proxy environment variables.
|
|
||||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
|
||||||
*/
|
|
||||||
getAgent(serverUrl) {
|
|
||||||
const parsedUrl = new URL(serverUrl);
|
|
||||||
return this._getAgent(parsedUrl);
|
|
||||||
}
|
|
||||||
_prepareRequest(method, requestUrl, headers) {
|
|
||||||
const info = {};
|
|
||||||
info.parsedUrl = requestUrl;
|
|
||||||
const usingSsl = info.parsedUrl.protocol === 'https:';
|
|
||||||
info.httpModule = usingSsl ? https : http;
|
|
||||||
const defaultPort = usingSsl ? 443 : 80;
|
|
||||||
info.options = {};
|
|
||||||
info.options.host = info.parsedUrl.hostname;
|
|
||||||
info.options.port = info.parsedUrl.port
|
|
||||||
? parseInt(info.parsedUrl.port)
|
|
||||||
: defaultPort;
|
|
||||||
info.options.path =
|
|
||||||
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
|
||||||
info.options.method = method;
|
|
||||||
info.options.headers = this._mergeHeaders(headers);
|
|
||||||
if (this.userAgent != null) {
|
|
||||||
info.options.headers['user-agent'] = this.userAgent;
|
|
||||||
}
|
|
||||||
info.options.agent = this._getAgent(info.parsedUrl);
|
|
||||||
// gives handlers an opportunity to participate
|
|
||||||
if (this.handlers) {
|
|
||||||
for (const handler of this.handlers) {
|
|
||||||
handler.prepareRequest(info.options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
_mergeHeaders(headers) {
|
|
||||||
if (this.requestOptions && this.requestOptions.headers) {
|
|
||||||
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
|
|
||||||
}
|
|
||||||
return lowercaseKeys(headers || {});
|
|
||||||
}
|
|
||||||
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
|
||||||
let clientHeader;
|
|
||||||
if (this.requestOptions && this.requestOptions.headers) {
|
|
||||||
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
|
||||||
}
|
|
||||||
return additionalHeaders[header] || clientHeader || _default;
|
|
||||||
}
|
|
||||||
_getAgent(parsedUrl) {
|
|
||||||
let agent;
|
|
||||||
const proxyUrl = pm.getProxyUrl(parsedUrl);
|
|
||||||
const useProxy = proxyUrl && proxyUrl.hostname;
|
|
||||||
if (this._keepAlive && useProxy) {
|
|
||||||
agent = this._proxyAgent;
|
|
||||||
}
|
|
||||||
if (this._keepAlive && !useProxy) {
|
|
||||||
agent = this._agent;
|
|
||||||
}
|
|
||||||
// if agent is already assigned use that agent.
|
|
||||||
if (agent) {
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
const usingSsl = parsedUrl.protocol === 'https:';
|
|
||||||
let maxSockets = 100;
|
|
||||||
if (this.requestOptions) {
|
|
||||||
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
|
||||||
}
|
|
||||||
// This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
|
|
||||||
if (proxyUrl && proxyUrl.hostname) {
|
|
||||||
const agentOptions = {
|
|
||||||
maxSockets,
|
|
||||||
keepAlive: this._keepAlive,
|
|
||||||
proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
|
|
||||||
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
|
|
||||||
})), { host: proxyUrl.hostname, port: proxyUrl.port })
|
|
||||||
};
|
|
||||||
let tunnelAgent;
|
|
||||||
const overHttps = proxyUrl.protocol === 'https:';
|
|
||||||
if (usingSsl) {
|
|
||||||
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
|
||||||
}
|
|
||||||
agent = tunnelAgent(agentOptions);
|
|
||||||
this._proxyAgent = agent;
|
|
||||||
}
|
|
||||||
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
|
||||||
if (this._keepAlive && !agent) {
|
|
||||||
const options = { keepAlive: this._keepAlive, maxSockets };
|
|
||||||
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
|
||||||
this._agent = agent;
|
|
||||||
}
|
|
||||||
// if not using private agent and tunnel agent isn't setup then use global agent
|
|
||||||
if (!agent) {
|
|
||||||
agent = usingSsl ? https.globalAgent : http.globalAgent;
|
|
||||||
}
|
|
||||||
if (usingSsl && this._ignoreSslError) {
|
|
||||||
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
|
||||||
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
|
||||||
// we have to cast it to any and change it directly
|
|
||||||
agent.options = Object.assign(agent.options || {}, {
|
|
||||||
rejectUnauthorized: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
_performExponentialBackoff(retryNumber) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
|
||||||
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
|
||||||
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
_processResponse(res, options) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const statusCode = res.message.statusCode || 0;
|
|
||||||
const response = {
|
|
||||||
statusCode,
|
|
||||||
result: null,
|
|
||||||
headers: {}
|
|
||||||
};
|
|
||||||
// not found leads to null obj returned
|
|
||||||
if (statusCode === HttpCodes.NotFound) {
|
|
||||||
resolve(response);
|
|
||||||
}
|
|
||||||
// get the result from the body
|
|
||||||
function dateTimeDeserializer(key, value) {
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
const a = new Date(value);
|
|
||||||
if (!isNaN(a.valueOf())) {
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
let obj;
|
|
||||||
let contents;
|
|
||||||
try {
|
|
||||||
contents = yield res.readBody();
|
|
||||||
if (contents && contents.length > 0) {
|
|
||||||
if (options && options.deserializeDates) {
|
|
||||||
obj = JSON.parse(contents, dateTimeDeserializer);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
obj = JSON.parse(contents);
|
|
||||||
}
|
|
||||||
response.result = obj;
|
|
||||||
}
|
|
||||||
response.headers = res.message.headers;
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
// Invalid resource (contents not json); leaving result obj null
|
|
||||||
}
|
|
||||||
// note that 3xx redirects are handled by the http layer.
|
|
||||||
if (statusCode > 299) {
|
|
||||||
let msg;
|
|
||||||
// if exception/error in body, attempt to get better error
|
|
||||||
if (obj && obj.message) {
|
|
||||||
msg = obj.message;
|
|
||||||
}
|
|
||||||
else if (contents && contents.length > 0) {
|
|
||||||
// it may be the case that the exception is in the body message as string
|
|
||||||
msg = contents;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
msg = `Failed request: (${statusCode})`;
|
|
||||||
}
|
|
||||||
const err = new HttpClientError(msg, statusCode);
|
|
||||||
err.result = response.result;
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
resolve(response);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.HttpClient = HttpClient;
|
|
||||||
const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
||||||
-1
File diff suppressed because one or more lines are too long
-44
@@ -1,44 +0,0 @@
|
|||||||
/// <reference types="node" />
|
|
||||||
import * as http from 'http';
|
|
||||||
import * as https from 'https';
|
|
||||||
import { HttpClientResponse } from './index';
|
|
||||||
export interface HttpClient {
|
|
||||||
options(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
get(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
del(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
post(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
patch(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
put(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: http.OutgoingHttpHeaders): Promise<HttpClientResponse>;
|
|
||||||
requestRaw(info: RequestInfo, data: string | NodeJS.ReadableStream): Promise<HttpClientResponse>;
|
|
||||||
requestRawWithCallback(info: RequestInfo, data: string | NodeJS.ReadableStream, onResult: (err?: Error, res?: HttpClientResponse) => void): void;
|
|
||||||
}
|
|
||||||
export interface RequestHandler {
|
|
||||||
prepareRequest(options: http.RequestOptions): void;
|
|
||||||
canHandleAuthentication(response: HttpClientResponse): boolean;
|
|
||||||
handleAuthentication(httpClient: HttpClient, requestInfo: RequestInfo, data: string | NodeJS.ReadableStream | null): Promise<HttpClientResponse>;
|
|
||||||
}
|
|
||||||
export interface RequestInfo {
|
|
||||||
options: http.RequestOptions;
|
|
||||||
parsedUrl: URL;
|
|
||||||
httpModule: typeof http | typeof https;
|
|
||||||
}
|
|
||||||
export interface RequestOptions {
|
|
||||||
headers?: http.OutgoingHttpHeaders;
|
|
||||||
socketTimeout?: number;
|
|
||||||
ignoreSslError?: boolean;
|
|
||||||
allowRedirects?: boolean;
|
|
||||||
allowRedirectDowngrade?: boolean;
|
|
||||||
maxRedirects?: number;
|
|
||||||
maxSockets?: number;
|
|
||||||
keepAlive?: boolean;
|
|
||||||
deserializeDates?: boolean;
|
|
||||||
allowRetries?: boolean;
|
|
||||||
maxRetries?: number;
|
|
||||||
}
|
|
||||||
export interface TypedResponse<T> {
|
|
||||||
statusCode: number;
|
|
||||||
result: T | null;
|
|
||||||
headers: http.IncomingHttpHeaders;
|
|
||||||
}
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
//# sourceMappingURL=interfaces.js.map
|
|
||||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
export declare function getProxyUrl(reqUrl: URL): URL | undefined;
|
|
||||||
export declare function checkBypass(reqUrl: URL): boolean;
|
|
||||||
-61
@@ -1,61 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.checkBypass = exports.getProxyUrl = void 0;
|
|
||||||
function getProxyUrl(reqUrl) {
|
|
||||||
const usingSsl = reqUrl.protocol === 'https:';
|
|
||||||
if (checkBypass(reqUrl)) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const proxyVar = (() => {
|
|
||||||
if (usingSsl) {
|
|
||||||
return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return process.env['http_proxy'] || process.env['HTTP_PROXY'];
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
if (proxyVar) {
|
|
||||||
return new URL(proxyVar);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.getProxyUrl = getProxyUrl;
|
|
||||||
function checkBypass(reqUrl) {
|
|
||||||
if (!reqUrl.hostname) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
|
||||||
if (!noProxy) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Determine the request port
|
|
||||||
let reqPort;
|
|
||||||
if (reqUrl.port) {
|
|
||||||
reqPort = Number(reqUrl.port);
|
|
||||||
}
|
|
||||||
else if (reqUrl.protocol === 'http:') {
|
|
||||||
reqPort = 80;
|
|
||||||
}
|
|
||||||
else if (reqUrl.protocol === 'https:') {
|
|
||||||
reqPort = 443;
|
|
||||||
}
|
|
||||||
// Format the request hostname and hostname with port
|
|
||||||
const upperReqHosts = [reqUrl.hostname.toUpperCase()];
|
|
||||||
if (typeof reqPort === 'number') {
|
|
||||||
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
|
||||||
}
|
|
||||||
// Compare request host against noproxy
|
|
||||||
for (const upperNoProxyItem of noProxy
|
|
||||||
.split(',')
|
|
||||||
.map(x => x.trim().toUpperCase())
|
|
||||||
.filter(x => x)) {
|
|
||||||
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
exports.checkBypass = checkBypass;
|
|
||||||
//# sourceMappingURL=proxy.js.map
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAA;IAE7C,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ,EAAE;YACZ,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;SAChE;aAAM;YACL,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;SAC9D;IACH,CAAC,CAAC,EAAE,CAAA;IAEJ,IAAI,QAAQ,EAAE;QACZ,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;KACzB;SAAM;QACL,OAAO,SAAS,CAAA;KACjB;AACH,CAAC;AApBD,kCAoBC;AAED,SAAgB,WAAW,CAAC,MAAW;IACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACxE,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAA;KACb;IAED,6BAA6B;IAC7B,IAAI,OAA2B,CAAA;IAC/B,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;KAC9B;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,EAAE;QACtC,OAAO,GAAG,EAAE,CAAA;KACb;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACvC,OAAO,GAAG,GAAG,CAAA;KACd;IAED,qDAAqD;IACrD,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAA;KACrD;IAED,uCAAuC;IACvC,KAAK,MAAM,gBAAgB,IAAI,OAAO;SACnC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACjB,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,gBAAgB,CAAC,EAAE;YACnD,OAAO,IAAI,CAAA;SACZ;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AArCD,kCAqCC"}
|
|
||||||
-48
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@actions/http-client",
|
|
||||||
"version": "2.0.1",
|
|
||||||
"description": "Actions Http Client",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"http"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client",
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/index.js",
|
|
||||||
"types": "lib/index.d.ts",
|
|
||||||
"directories": {
|
|
||||||
"lib": "lib",
|
|
||||||
"test": "__tests__"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib",
|
|
||||||
"!.DS_Store"
|
|
||||||
],
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/actions/toolkit.git",
|
|
||||||
"directory": "packages/http-client"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
||||||
"build": "tsc",
|
|
||||||
"format": "prettier --write **/*.ts",
|
|
||||||
"format-check": "prettier --check **/*.ts",
|
|
||||||
"tsc": "tsc"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/tunnel": "0.0.3",
|
|
||||||
"proxy": "^1.0.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tunnel": "^0.0.6"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-229
@@ -1,229 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
||||||
|
|
||||||
### [8.3.2](https://github.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- lazy load getRandomValues ([#537](https://github.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://github.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#536](https://github.com/uuidjs/uuid/issues/536)
|
|
||||||
|
|
||||||
### [8.3.1](https://github.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- support expo>=39.0.0 ([#515](https://github.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://github.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#375](https://github.com/uuidjs/uuid/issues/375)
|
|
||||||
|
|
||||||
## [8.3.0](https://github.com/uuidjs/uuid/compare/v8.2.0...v8.3.0) (2020-07-27)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4)), closes [#475](https://github.com/uuidjs/uuid/issues/475) [#478](https://github.com/uuidjs/uuid/issues/478) [#480](https://github.com/uuidjs/uuid/issues/480) [#481](https://github.com/uuidjs/uuid/issues/481) [#180](https://github.com/uuidjs/uuid/issues/180)
|
|
||||||
|
|
||||||
## [8.2.0](https://github.com/uuidjs/uuid/compare/v8.1.0...v8.2.0) (2020-06-23)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5))
|
|
||||||
- remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c)), closes [#437](https://github.com/uuidjs/uuid/issues/437)
|
|
||||||
- support jspm ([#473](https://github.com/uuidjs/uuid/issues/473)) ([e9f2587](https://github.com/uuidjs/uuid/commit/e9f2587a92575cac31bc1d4ae944e17c09756659))
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8))
|
|
||||||
|
|
||||||
## [8.1.0](https://github.com/uuidjs/uuid/compare/v8.0.0...v8.1.0) (2020-05-20)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d))
|
|
||||||
- optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2))
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [ai/nanoevents#44](https://github.com/ai/nanoevents/issues/44#issuecomment-602010343) [#444](https://github.com/uuidjs/uuid/issues/444)
|
|
||||||
|
|
||||||
## [8.0.0](https://github.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) (2020-04-29)
|
|
||||||
|
|
||||||
### ⚠ BREAKING CHANGES
|
|
||||||
|
|
||||||
- For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export.
|
|
||||||
|
|
||||||
```diff
|
|
||||||
-import uuid from 'uuid';
|
|
||||||
-console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869'
|
|
||||||
+import { v4 as uuidv4 } from 'uuid';
|
|
||||||
+uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
|
||||||
```
|
|
||||||
|
|
||||||
- Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported.
|
|
||||||
|
|
||||||
Instead use the named exports that this module exports.
|
|
||||||
|
|
||||||
For ECMAScript Modules (ESM):
|
|
||||||
|
|
||||||
```diff
|
|
||||||
-import uuidv4 from 'uuid/v4';
|
|
||||||
+import { v4 as uuidv4 } from 'uuid';
|
|
||||||
uuidv4();
|
|
||||||
```
|
|
||||||
|
|
||||||
For CommonJS:
|
|
||||||
|
|
||||||
```diff
|
|
||||||
-const uuidv4 = require('uuid/v4');
|
|
||||||
+const { v4: uuidv4 } = require('uuid');
|
|
||||||
uuidv4();
|
|
||||||
```
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- native Node.js ES Modules (wrapper approach) ([#423](https://github.com/uuidjs/uuid/issues/423)) ([2d9f590](https://github.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#245](https://github.com/uuidjs/uuid/issues/245) [#419](https://github.com/uuidjs/uuid/issues/419) [#342](https://github.com/uuidjs/uuid/issues/342)
|
|
||||||
- remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba))
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0))
|
|
||||||
|
|
||||||
### [7.0.3](https://github.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#408](https://github.com/uuidjs/uuid/issues/408)
|
|
||||||
|
|
||||||
### [7.0.2](https://github.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c))
|
|
||||||
- simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7))
|
|
||||||
- update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4))
|
|
||||||
|
|
||||||
### [7.0.1](https://github.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc))
|
|
||||||
- provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#378](https://github.com/uuidjs/uuid/issues/378)
|
|
||||||
|
|
||||||
## [7.0.0](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.0) (2020-02-24)
|
|
||||||
|
|
||||||
### ⚠ BREAKING CHANGES
|
|
||||||
|
|
||||||
- The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed.
|
|
||||||
- Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants.
|
|
||||||
- Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function.
|
|
||||||
- Remove support for generating v3 and v5 UUIDs in Node.js<4.x
|
|
||||||
- Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers.
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c)), closes [#345](https://github.com/uuidjs/uuid/issues/345)
|
|
||||||
- add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555))
|
|
||||||
- ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b))
|
|
||||||
- hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0))
|
|
||||||
- remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9)), closes [#173](https://github.com/uuidjs/uuid/issues/173)
|
|
||||||
- remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627))
|
|
||||||
- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48))
|
|
||||||
- add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370)
|
|
||||||
- deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23))
|
|
||||||
|
|
||||||
## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338)
|
|
||||||
|
|
||||||
## [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- no longer run ci tests on node v4
|
|
||||||
- upgrade dependencies
|
|
||||||
|
|
||||||
## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877))
|
|
||||||
|
|
||||||
## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2))
|
|
||||||
|
|
||||||
# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc))
|
|
||||||
- fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4))
|
|
||||||
- Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331))
|
|
||||||
- mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c))
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182))
|
|
||||||
|
|
||||||
## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b))
|
|
||||||
|
|
||||||
# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824))
|
|
||||||
- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b))
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726))
|
|
||||||
|
|
||||||
# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183)
|
|
||||||
- Fix typo (#178)
|
|
||||||
- Simple typo fix (#165)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- v5 support in CLI (#197)
|
|
||||||
- V5 support (#188)
|
|
||||||
|
|
||||||
# 3.0.1 (2016-11-28)
|
|
||||||
|
|
||||||
- split uuid versions into separate files
|
|
||||||
|
|
||||||
# 3.0.0 (2016-11-17)
|
|
||||||
|
|
||||||
- remove .parse and .unparse
|
|
||||||
|
|
||||||
# 2.0.0
|
|
||||||
|
|
||||||
- Removed uuid.BufferClass
|
|
||||||
|
|
||||||
# 1.4.0
|
|
||||||
|
|
||||||
- Improved module context detection
|
|
||||||
- Removed public RNG functions
|
|
||||||
|
|
||||||
# 1.3.2
|
|
||||||
|
|
||||||
- Improve tests and handling of v1() options (Issue #24)
|
|
||||||
- Expose RNG option to allow for perf testing with different generators
|
|
||||||
|
|
||||||
# 1.3.0
|
|
||||||
|
|
||||||
- Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
|
|
||||||
- Support for node.js crypto API
|
|
||||||
- De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
# Contributing
|
|
||||||
|
|
||||||
Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library!
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm test
|
|
||||||
```
|
|
||||||
|
|
||||||
## Releasing
|
|
||||||
|
|
||||||
Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version):
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm run release -- --dry-run # verify output manually
|
|
||||||
npm run release # follow the instructions from the output of this command
|
|
||||||
```
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
-505
@@ -1,505 +0,0 @@
|
|||||||
<!--
|
|
||||||
-- This file is auto-generated from README_js.md. Changes should be made there.
|
|
||||||
-->
|
|
||||||
|
|
||||||
# uuid [](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser)
|
|
||||||
|
|
||||||
For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
|
|
||||||
|
|
||||||
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
|
|
||||||
- **Cross-platform** - Support for ...
|
|
||||||
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
|
|
||||||
- Node 8, 10, 12, 14
|
|
||||||
- Chrome, Safari, Firefox, Edge, IE 11 browsers
|
|
||||||
- Webpack and rollup.js module bundlers
|
|
||||||
- [React Native / Expo](#react-native--expo)
|
|
||||||
- **Secure** - Cryptographically-strong random values
|
|
||||||
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
|
|
||||||
- **CLI** - Includes the [`uuid` command line](#command-line) utility
|
|
||||||
|
|
||||||
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
|
|
||||||
|
|
||||||
## Quickstart
|
|
||||||
|
|
||||||
To create a random UUID...
|
|
||||||
|
|
||||||
**1. Install**
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install uuid
|
|
||||||
```
|
|
||||||
|
|
||||||
**2. Create a UUID** (ES6 module syntax)
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
|
||||||
```
|
|
||||||
|
|
||||||
... or using CommonJS syntax:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const { v4: uuidv4 } = require('uuid');
|
|
||||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
|
||||||
```
|
|
||||||
|
|
||||||
For timestamp UUIDs, namespace UUIDs, and other options read on ...
|
|
||||||
|
|
||||||
## API Summary
|
|
||||||
|
|
||||||
| | | |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` |
|
|
||||||
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` |
|
|
||||||
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` |
|
|
||||||
| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | |
|
|
||||||
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | |
|
|
||||||
| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | |
|
|
||||||
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | |
|
|
||||||
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` |
|
|
||||||
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` |
|
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
### uuid.NIL
|
|
||||||
|
|
||||||
The nil UUID string (all zeros).
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { NIL as NIL_UUID } from 'uuid';
|
|
||||||
|
|
||||||
NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000'
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.parse(str)
|
|
||||||
|
|
||||||
Convert UUID string to array of bytes
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --------- | ---------------------------------------- |
|
|
||||||
| `str` | A valid UUID `String` |
|
|
||||||
| _returns_ | `Uint8Array[16]` |
|
|
||||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
|
||||||
|
|
||||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { parse as uuidParse } from 'uuid';
|
|
||||||
|
|
||||||
// Parse a UUID
|
|
||||||
const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b');
|
|
||||||
|
|
||||||
// Convert to hex strings to show byte order (for documentation purposes)
|
|
||||||
[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨
|
|
||||||
// [
|
|
||||||
// '6e', 'c0', 'bd', '7f',
|
|
||||||
// '11', 'c0', '43', 'da',
|
|
||||||
// '97', '5e', '2a', '8a',
|
|
||||||
// 'd9', 'eb', 'ae', '0b'
|
|
||||||
// ]
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.stringify(arr[, offset])
|
|
||||||
|
|
||||||
Convert array of bytes to UUID string
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| -------------- | ---------------------------------------------------------------------------- |
|
|
||||||
| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. |
|
|
||||||
| [`offset` = 0] | `Number` Starting index in the Array |
|
|
||||||
| _returns_ | `String` |
|
|
||||||
| _throws_ | `TypeError` if a valid UUID string cannot be generated |
|
|
||||||
|
|
||||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { stringify as uuidStringify } from 'uuid';
|
|
||||||
|
|
||||||
const uuidBytes = [
|
|
||||||
0x6e,
|
|
||||||
0xc0,
|
|
||||||
0xbd,
|
|
||||||
0x7f,
|
|
||||||
0x11,
|
|
||||||
0xc0,
|
|
||||||
0x43,
|
|
||||||
0xda,
|
|
||||||
0x97,
|
|
||||||
0x5e,
|
|
||||||
0x2a,
|
|
||||||
0x8a,
|
|
||||||
0xd9,
|
|
||||||
0xeb,
|
|
||||||
0xae,
|
|
||||||
0x0b,
|
|
||||||
];
|
|
||||||
|
|
||||||
uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.v1([options[, buffer[, offset]]])
|
|
||||||
|
|
||||||
Create an RFC version 1 (timestamp) UUID
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --- | --- |
|
|
||||||
| [`options`] | `Object` with one or more of the following properties: |
|
|
||||||
| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
|
|
||||||
| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
|
|
||||||
| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
|
|
||||||
| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) |
|
|
||||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
|
||||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
|
||||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
|
||||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
|
||||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
|
||||||
| _throws_ | `Error` if more than 10M UUIDs/sec are requested |
|
|
||||||
|
|
||||||
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
|
|
||||||
|
|
||||||
Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v1 as uuidv1 } from 'uuid';
|
|
||||||
|
|
||||||
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
|
|
||||||
```
|
|
||||||
|
|
||||||
Example using `options`:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v1 as uuidv1 } from 'uuid';
|
|
||||||
|
|
||||||
const v1options = {
|
|
||||||
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
|
||||||
clockseq: 0x1234,
|
|
||||||
msecs: new Date('2011-11-01').getTime(),
|
|
||||||
nsecs: 5678,
|
|
||||||
};
|
|
||||||
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.v3(name, namespace[, buffer[, offset]])
|
|
||||||
|
|
||||||
Create an RFC version 3 (namespace w/ MD5) UUID
|
|
||||||
|
|
||||||
API is identical to `v5()`, but uses "v3" instead.
|
|
||||||
|
|
||||||
⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
|
|
||||||
|
|
||||||
### uuid.v4([options[, buffer[, offset]]])
|
|
||||||
|
|
||||||
Create an RFC version 4 (random) UUID
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --- | --- |
|
|
||||||
| [`options`] | `Object` with one or more of the following properties: |
|
|
||||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
|
||||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
|
||||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
|
||||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
|
||||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
|
|
||||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
|
||||||
```
|
|
||||||
|
|
||||||
Example using predefined `random` values:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
|
|
||||||
const v4options = {
|
|
||||||
random: [
|
|
||||||
0x10,
|
|
||||||
0x91,
|
|
||||||
0x56,
|
|
||||||
0xbe,
|
|
||||||
0xc4,
|
|
||||||
0xfb,
|
|
||||||
0xc1,
|
|
||||||
0xea,
|
|
||||||
0x71,
|
|
||||||
0xb4,
|
|
||||||
0xef,
|
|
||||||
0xe1,
|
|
||||||
0x67,
|
|
||||||
0x1c,
|
|
||||||
0x58,
|
|
||||||
0x36,
|
|
||||||
],
|
|
||||||
};
|
|
||||||
uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836'
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.v5(name, namespace[, buffer[, offset]])
|
|
||||||
|
|
||||||
Create an RFC version 5 (namespace w/ SHA-1) UUID
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --- | --- |
|
|
||||||
| `name` | `String \| Array` |
|
|
||||||
| `namespace` | `String \| Array[16]` Namespace UUID |
|
|
||||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
|
||||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
|
||||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
|
||||||
|
|
||||||
Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
|
|
||||||
|
|
||||||
Example with custom namespace:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v5 as uuidv5 } from 'uuid';
|
|
||||||
|
|
||||||
// Define a custom namespace. Readers, create your own using something like
|
|
||||||
// https://www.uuidgenerator.net/
|
|
||||||
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
|
|
||||||
|
|
||||||
uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
|
|
||||||
```
|
|
||||||
|
|
||||||
Example with RFC `URL` namespace:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v5 as uuidv5 } from 'uuid';
|
|
||||||
|
|
||||||
uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1'
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.validate(str)
|
|
||||||
|
|
||||||
Test a string to see if it is a valid UUID
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --------- | --------------------------------------------------- |
|
|
||||||
| `str` | `String` to validate |
|
|
||||||
| _returns_ | `true` if string is a valid UUID, `false` otherwise |
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { validate as uuidValidate } from 'uuid';
|
|
||||||
|
|
||||||
uuidValidate('not a UUID'); // ⇨ false
|
|
||||||
uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true
|
|
||||||
```
|
|
||||||
|
|
||||||
Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { version as uuidVersion } from 'uuid';
|
|
||||||
import { validate as uuidValidate } from 'uuid';
|
|
||||||
|
|
||||||
function uuidValidateV4(uuid) {
|
|
||||||
return uuidValidate(uuid) && uuidVersion(uuid) === 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210';
|
|
||||||
const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836';
|
|
||||||
|
|
||||||
uuidValidateV4(v4Uuid); // ⇨ true
|
|
||||||
uuidValidateV4(v1Uuid); // ⇨ false
|
|
||||||
```
|
|
||||||
|
|
||||||
### uuid.version(str)
|
|
||||||
|
|
||||||
Detect RFC version of a UUID
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --------- | ---------------------------------------- |
|
|
||||||
| `str` | A valid UUID `String` |
|
|
||||||
| _returns_ | `Number` The RFC version of the UUID |
|
|
||||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { version as uuidVersion } from 'uuid';
|
|
||||||
|
|
||||||
uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1
|
|
||||||
uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4
|
|
||||||
```
|
|
||||||
|
|
||||||
## Command Line
|
|
||||||
|
|
||||||
UUIDs can be generated from the command line using `uuid`.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ uuid
|
|
||||||
ddeb27fb-d9a0-4624-be4d-4615062daed4
|
|
||||||
```
|
|
||||||
|
|
||||||
The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ uuid --help
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
uuid
|
|
||||||
uuid v1
|
|
||||||
uuid v3 <name> <namespace uuid>
|
|
||||||
uuid v4
|
|
||||||
uuid v5 <name> <namespace uuid>
|
|
||||||
uuid --help
|
|
||||||
|
|
||||||
Note: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs
|
|
||||||
defined by RFC4122
|
|
||||||
```
|
|
||||||
|
|
||||||
## ECMAScript Modules
|
|
||||||
|
|
||||||
This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments).
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
|
||||||
```
|
|
||||||
|
|
||||||
To run the examples you must first create a dist build of this library in the module root:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
## CDN Builds
|
|
||||||
|
|
||||||
### ECMAScript Modules
|
|
||||||
|
|
||||||
To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/):
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script type="module">
|
|
||||||
import { v4 as uuidv4 } from 'https://jspm.dev/uuid';
|
|
||||||
console.log(uuidv4()); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
|
|
||||||
### UMD
|
|
||||||
|
|
||||||
To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs:
|
|
||||||
|
|
||||||
**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="https://unpkg.com/uuid@latest/dist/umd/uuidv4.min.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/uuidv4.min.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
**Using [cdnjs](https://cdnjs.com/libraries/uuid)**:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/uuid/8.1.0/uuidv4.min.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script>
|
|
||||||
uuidv4(); // ⇨ '55af1e37-0734-46d8-b070-a1e42e4fc392'
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
|
|
||||||
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
|
|
||||||
|
|
||||||
## "getRandomValues() not supported"
|
|
||||||
|
|
||||||
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
|
|
||||||
|
|
||||||
### React Native / Expo
|
|
||||||
|
|
||||||
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
|
|
||||||
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import 'react-native-get-random-values';
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`.
|
|
||||||
|
|
||||||
### Web Workers / Service Workers (Edge <= 18)
|
|
||||||
|
|
||||||
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
|
|
||||||
|
|
||||||
## Upgrading From `uuid@7.x`
|
|
||||||
|
|
||||||
### Only Named Exports Supported When Using with Node.js ESM
|
|
||||||
|
|
||||||
`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
|
|
||||||
|
|
||||||
Instead of doing:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import uuid from 'uuid';
|
|
||||||
uuid.v4();
|
|
||||||
```
|
|
||||||
|
|
||||||
you will now have to use the named exports:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
uuidv4();
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deep Requires No Longer Supported
|
|
||||||
|
|
||||||
Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported.
|
|
||||||
|
|
||||||
## Upgrading From `uuid@3.x`
|
|
||||||
|
|
||||||
"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_"
|
|
||||||
|
|
||||||
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
|
|
||||||
|
|
||||||
### Deep Requires Now Deprecated
|
|
||||||
|
|
||||||
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
|
|
||||||
uuidv4();
|
|
||||||
```
|
|
||||||
|
|
||||||
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
uuidv4();
|
|
||||||
```
|
|
||||||
|
|
||||||
... or for CommonJS:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const { v4: uuidv4 } = require('uuid');
|
|
||||||
uuidv4();
|
|
||||||
```
|
|
||||||
|
|
||||||
### Default Export Removed
|
|
||||||
|
|
||||||
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const uuid = require('uuid'); // <== REMOVED!
|
|
||||||
```
|
|
||||||
|
|
||||||
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
|
|
||||||
|
|
||||||
----
|
|
||||||
Markdown generated from [README_js.md](README_js.md) by [](https://github.com/broofa/runmd)
|
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
require('../uuid-bin');
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
export { default as v1 } from './v1.js';
|
|
||||||
export { default as v3 } from './v3.js';
|
|
||||||
export { default as v4 } from './v4.js';
|
|
||||||
export { default as v5 } from './v5.js';
|
|
||||||
export { default as NIL } from './nil.js';
|
|
||||||
export { default as version } from './version.js';
|
|
||||||
export { default as validate } from './validate.js';
|
|
||||||
export { default as stringify } from './stringify.js';
|
|
||||||
export { default as parse } from './parse.js';
|
|
||||||
-215
@@ -1,215 +0,0 @@
|
|||||||
/*
|
|
||||||
* Browser-compatible JavaScript MD5
|
|
||||||
*
|
|
||||||
* Modification of JavaScript MD5
|
|
||||||
* https://github.com/blueimp/JavaScript-MD5
|
|
||||||
*
|
|
||||||
* Copyright 2011, Sebastian Tschan
|
|
||||||
* https://blueimp.net
|
|
||||||
*
|
|
||||||
* Licensed under the MIT license:
|
|
||||||
* https://opensource.org/licenses/MIT
|
|
||||||
*
|
|
||||||
* Based on
|
|
||||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
||||||
* Digest Algorithm, as defined in RFC 1321.
|
|
||||||
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
||||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
||||||
* Distributed under the BSD License
|
|
||||||
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
||||||
*/
|
|
||||||
function md5(bytes) {
|
|
||||||
if (typeof bytes === 'string') {
|
|
||||||
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
||||||
|
|
||||||
bytes = new Uint8Array(msg.length);
|
|
||||||
|
|
||||||
for (var i = 0; i < msg.length; ++i) {
|
|
||||||
bytes[i] = msg.charCodeAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Convert an array of little-endian words to an array of bytes
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function md5ToHexEncodedArray(input) {
|
|
||||||
var output = [];
|
|
||||||
var length32 = input.length * 32;
|
|
||||||
var hexTab = '0123456789abcdef';
|
|
||||||
|
|
||||||
for (var i = 0; i < length32; i += 8) {
|
|
||||||
var x = input[i >> 5] >>> i % 32 & 0xff;
|
|
||||||
var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
|
||||||
output.push(hex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Calculate output length with padding and bit length
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function getOutputLength(inputLength8) {
|
|
||||||
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function wordsToMd5(x, len) {
|
|
||||||
/* append padding */
|
|
||||||
x[len >> 5] |= 0x80 << len % 32;
|
|
||||||
x[getOutputLength(len) - 1] = len;
|
|
||||||
var a = 1732584193;
|
|
||||||
var b = -271733879;
|
|
||||||
var c = -1732584194;
|
|
||||||
var d = 271733878;
|
|
||||||
|
|
||||||
for (var i = 0; i < x.length; i += 16) {
|
|
||||||
var olda = a;
|
|
||||||
var oldb = b;
|
|
||||||
var oldc = c;
|
|
||||||
var oldd = d;
|
|
||||||
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
||||||
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
||||||
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
||||||
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
||||||
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
||||||
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
||||||
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
||||||
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
||||||
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
||||||
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
||||||
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
||||||
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
||||||
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
||||||
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
||||||
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
||||||
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
||||||
a = safeAdd(a, olda);
|
|
||||||
b = safeAdd(b, oldb);
|
|
||||||
c = safeAdd(c, oldc);
|
|
||||||
d = safeAdd(d, oldd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [a, b, c, d];
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Convert an array bytes to an array of little-endian words
|
|
||||||
* Characters >255 have their high-byte silently ignored.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function bytesToWords(input) {
|
|
||||||
if (input.length === 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
var length8 = input.length * 8;
|
|
||||||
var output = new Uint32Array(getOutputLength(length8));
|
|
||||||
|
|
||||||
for (var i = 0; i < length8; i += 8) {
|
|
||||||
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
||||||
* to work around bugs in some JS interpreters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function safeAdd(x, y) {
|
|
||||||
var lsw = (x & 0xffff) + (y & 0xffff);
|
|
||||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
||||||
return msw << 16 | lsw & 0xffff;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Bitwise rotate a 32-bit number to the left.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function bitRotateLeft(num, cnt) {
|
|
||||||
return num << cnt | num >>> 32 - cnt;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* These functions implement the four basic operations the algorithm uses.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function md5cmn(q, a, b, x, s, t) {
|
|
||||||
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5ff(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5gg(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5hh(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5ii(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default md5;
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export default '00000000-0000-0000-0000-000000000000';
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
import validate from './validate.js';
|
|
||||||
|
|
||||||
function parse(uuid) {
|
|
||||||
if (!validate(uuid)) {
|
|
||||||
throw TypeError('Invalid UUID');
|
|
||||||
}
|
|
||||||
|
|
||||||
var v;
|
|
||||||
var arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
||||||
|
|
||||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
||||||
arr[1] = v >>> 16 & 0xff;
|
|
||||||
arr[2] = v >>> 8 & 0xff;
|
|
||||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
||||||
|
|
||||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
||||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
||||||
|
|
||||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
||||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
||||||
|
|
||||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
||||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
||||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
||||||
|
|
||||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
||||||
arr[11] = v / 0x100000000 & 0xff;
|
|
||||||
arr[12] = v >>> 24 & 0xff;
|
|
||||||
arr[13] = v >>> 16 & 0xff;
|
|
||||||
arr[14] = v >>> 8 & 0xff;
|
|
||||||
arr[15] = v & 0xff;
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default parse;
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
||||||
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
||||||
// generators (like Math.random()).
|
|
||||||
var getRandomValues;
|
|
||||||
var rnds8 = new Uint8Array(16);
|
|
||||||
export default function rng() {
|
|
||||||
// lazy load so that environments that need to polyfill have a chance to do so
|
|
||||||
if (!getRandomValues) {
|
|
||||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
||||||
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
||||||
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
||||||
|
|
||||||
if (!getRandomValues) {
|
|
||||||
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return getRandomValues(rnds8);
|
|
||||||
}
|
|
||||||
-96
@@ -1,96 +0,0 @@
|
|||||||
// Adapted from Chris Veness' SHA1 code at
|
|
||||||
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
||||||
function f(s, x, y, z) {
|
|
||||||
switch (s) {
|
|
||||||
case 0:
|
|
||||||
return x & y ^ ~x & z;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
return x ^ y ^ z;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return x & y ^ x & z ^ y & z;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return x ^ y ^ z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ROTL(x, n) {
|
|
||||||
return x << n | x >>> 32 - n;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sha1(bytes) {
|
|
||||||
var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
||||||
var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
||||||
|
|
||||||
if (typeof bytes === 'string') {
|
|
||||||
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
||||||
|
|
||||||
bytes = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < msg.length; ++i) {
|
|
||||||
bytes.push(msg.charCodeAt(i));
|
|
||||||
}
|
|
||||||
} else if (!Array.isArray(bytes)) {
|
|
||||||
// Convert Array-like to Array
|
|
||||||
bytes = Array.prototype.slice.call(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
bytes.push(0x80);
|
|
||||||
var l = bytes.length / 4 + 2;
|
|
||||||
var N = Math.ceil(l / 16);
|
|
||||||
var M = new Array(N);
|
|
||||||
|
|
||||||
for (var _i = 0; _i < N; ++_i) {
|
|
||||||
var arr = new Uint32Array(16);
|
|
||||||
|
|
||||||
for (var j = 0; j < 16; ++j) {
|
|
||||||
arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];
|
|
||||||
}
|
|
||||||
|
|
||||||
M[_i] = arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
||||||
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
||||||
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
||||||
|
|
||||||
for (var _i2 = 0; _i2 < N; ++_i2) {
|
|
||||||
var W = new Uint32Array(80);
|
|
||||||
|
|
||||||
for (var t = 0; t < 16; ++t) {
|
|
||||||
W[t] = M[_i2][t];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var _t = 16; _t < 80; ++_t) {
|
|
||||||
W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
var a = H[0];
|
|
||||||
var b = H[1];
|
|
||||||
var c = H[2];
|
|
||||||
var d = H[3];
|
|
||||||
var e = H[4];
|
|
||||||
|
|
||||||
for (var _t2 = 0; _t2 < 80; ++_t2) {
|
|
||||||
var s = Math.floor(_t2 / 20);
|
|
||||||
var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;
|
|
||||||
e = d;
|
|
||||||
d = c;
|
|
||||||
c = ROTL(b, 30) >>> 0;
|
|
||||||
b = a;
|
|
||||||
a = T;
|
|
||||||
}
|
|
||||||
|
|
||||||
H[0] = H[0] + a >>> 0;
|
|
||||||
H[1] = H[1] + b >>> 0;
|
|
||||||
H[2] = H[2] + c >>> 0;
|
|
||||||
H[3] = H[3] + d >>> 0;
|
|
||||||
H[4] = H[4] + e >>> 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
||||||
}
|
|
||||||
|
|
||||||
export default sha1;
|
|
||||||
-30
@@ -1,30 +0,0 @@
|
|||||||
import validate from './validate.js';
|
|
||||||
/**
|
|
||||||
* Convert array of 16 byte values to UUID string format of the form:
|
|
||||||
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
||||||
*/
|
|
||||||
|
|
||||||
var byteToHex = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < 256; ++i) {
|
|
||||||
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
function stringify(arr) {
|
|
||||||
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
||||||
// Note: Be careful editing this code! It's been tuned for performance
|
|
||||||
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
||||||
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
||||||
// of the following:
|
|
||||||
// - One or more input array values don't map to a hex octet (leading to
|
|
||||||
// "undefined" in the uuid)
|
|
||||||
// - Invalid input values for the RFC `version` or `variant` fields
|
|
||||||
|
|
||||||
if (!validate(uuid)) {
|
|
||||||
throw TypeError('Stringified UUID is invalid');
|
|
||||||
}
|
|
||||||
|
|
||||||
return uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default stringify;
|
|
||||||
-95
@@ -1,95 +0,0 @@
|
|||||||
import rng from './rng.js';
|
|
||||||
import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**
|
|
||||||
//
|
|
||||||
// Inspired by https://github.com/LiosK/UUID.js
|
|
||||||
// and http://docs.python.org/library/uuid.html
|
|
||||||
|
|
||||||
var _nodeId;
|
|
||||||
|
|
||||||
var _clockseq; // Previous uuid creation time
|
|
||||||
|
|
||||||
|
|
||||||
var _lastMSecs = 0;
|
|
||||||
var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
|
||||||
|
|
||||||
function v1(options, buf, offset) {
|
|
||||||
var i = buf && offset || 0;
|
|
||||||
var b = buf || new Array(16);
|
|
||||||
options = options || {};
|
|
||||||
var node = options.node || _nodeId;
|
|
||||||
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
|
||||||
// specified. We do this lazily to minimize issues related to insufficient
|
|
||||||
// system entropy. See #189
|
|
||||||
|
|
||||||
if (node == null || clockseq == null) {
|
|
||||||
var seedBytes = options.random || (options.rng || rng)();
|
|
||||||
|
|
||||||
if (node == null) {
|
|
||||||
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
||||||
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clockseq == null) {
|
|
||||||
// Per 4.2.2, randomize (14 bit) clockseq
|
|
||||||
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
||||||
}
|
|
||||||
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
||||||
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
||||||
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
||||||
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
||||||
|
|
||||||
|
|
||||||
var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
||||||
// cycle to simulate higher resolution clock
|
|
||||||
|
|
||||||
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
|
||||||
|
|
||||||
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
|
||||||
|
|
||||||
if (dt < 0 && options.clockseq === undefined) {
|
|
||||||
clockseq = clockseq + 1 & 0x3fff;
|
|
||||||
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
||||||
// time interval
|
|
||||||
|
|
||||||
|
|
||||||
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
||||||
nsecs = 0;
|
|
||||||
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
|
||||||
|
|
||||||
|
|
||||||
if (nsecs >= 10000) {
|
|
||||||
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastMSecs = msecs;
|
|
||||||
_lastNSecs = nsecs;
|
|
||||||
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
||||||
|
|
||||||
msecs += 12219292800000; // `time_low`
|
|
||||||
|
|
||||||
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
||||||
b[i++] = tl >>> 24 & 0xff;
|
|
||||||
b[i++] = tl >>> 16 & 0xff;
|
|
||||||
b[i++] = tl >>> 8 & 0xff;
|
|
||||||
b[i++] = tl & 0xff; // `time_mid`
|
|
||||||
|
|
||||||
var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
|
||||||
b[i++] = tmh >>> 8 & 0xff;
|
|
||||||
b[i++] = tmh & 0xff; // `time_high_and_version`
|
|
||||||
|
|
||||||
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
||||||
|
|
||||||
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
||||||
|
|
||||||
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
|
||||||
|
|
||||||
b[i++] = clockseq & 0xff; // `node`
|
|
||||||
|
|
||||||
for (var n = 0; n < 6; ++n) {
|
|
||||||
b[i + n] = node[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf || stringify(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default v1;
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
import v35 from './v35.js';
|
|
||||||
import md5 from './md5.js';
|
|
||||||
var v3 = v35('v3', 0x30, md5);
|
|
||||||
export default v3;
|
|
||||||
-64
@@ -1,64 +0,0 @@
|
|||||||
import stringify from './stringify.js';
|
|
||||||
import parse from './parse.js';
|
|
||||||
|
|
||||||
function stringToBytes(str) {
|
|
||||||
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
||||||
|
|
||||||
var bytes = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < str.length; ++i) {
|
|
||||||
bytes.push(str.charCodeAt(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
||||||
export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
||||||
export default function (name, version, hashfunc) {
|
|
||||||
function generateUUID(value, namespace, buf, offset) {
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
value = stringToBytes(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof namespace === 'string') {
|
|
||||||
namespace = parse(namespace);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (namespace.length !== 16) {
|
|
||||||
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
||||||
} // Compute hash of namespace and value, Per 4.3
|
|
||||||
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
||||||
// hashfunc([...namespace, ... value])`
|
|
||||||
|
|
||||||
|
|
||||||
var bytes = new Uint8Array(16 + value.length);
|
|
||||||
bytes.set(namespace);
|
|
||||||
bytes.set(value, namespace.length);
|
|
||||||
bytes = hashfunc(bytes);
|
|
||||||
bytes[6] = bytes[6] & 0x0f | version;
|
|
||||||
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
||||||
|
|
||||||
if (buf) {
|
|
||||||
offset = offset || 0;
|
|
||||||
|
|
||||||
for (var i = 0; i < 16; ++i) {
|
|
||||||
buf[offset + i] = bytes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stringify(bytes);
|
|
||||||
} // Function#name is not settable on some platforms (#270)
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
||||||
} catch (err) {} // For CommonJS default export support
|
|
||||||
|
|
||||||
|
|
||||||
generateUUID.DNS = DNS;
|
|
||||||
generateUUID.URL = URL;
|
|
||||||
return generateUUID;
|
|
||||||
}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
import rng from './rng.js';
|
|
||||||
import stringify from './stringify.js';
|
|
||||||
|
|
||||||
function v4(options, buf, offset) {
|
|
||||||
options = options || {};
|
|
||||||
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
||||||
|
|
||||||
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
||||||
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
||||||
|
|
||||||
if (buf) {
|
|
||||||
offset = offset || 0;
|
|
||||||
|
|
||||||
for (var i = 0; i < 16; ++i) {
|
|
||||||
buf[offset + i] = rnds[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stringify(rnds);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default v4;
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
import v35 from './v35.js';
|
|
||||||
import sha1 from './sha1.js';
|
|
||||||
var v5 = v35('v5', 0x50, sha1);
|
|
||||||
export default v5;
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
import REGEX from './regex.js';
|
|
||||||
|
|
||||||
function validate(uuid) {
|
|
||||||
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default validate;
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
import validate from './validate.js';
|
|
||||||
|
|
||||||
function version(uuid) {
|
|
||||||
if (!validate(uuid)) {
|
|
||||||
throw TypeError('Invalid UUID');
|
|
||||||
}
|
|
||||||
|
|
||||||
return parseInt(uuid.substr(14, 1), 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default version;
|
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
export { default as v1 } from './v1.js';
|
|
||||||
export { default as v3 } from './v3.js';
|
|
||||||
export { default as v4 } from './v4.js';
|
|
||||||
export { default as v5 } from './v5.js';
|
|
||||||
export { default as NIL } from './nil.js';
|
|
||||||
export { default as version } from './version.js';
|
|
||||||
export { default as validate } from './validate.js';
|
|
||||||
export { default as stringify } from './stringify.js';
|
|
||||||
export { default as parse } from './parse.js';
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
import crypto from 'crypto';
|
|
||||||
|
|
||||||
function md5(bytes) {
|
|
||||||
if (Array.isArray(bytes)) {
|
|
||||||
bytes = Buffer.from(bytes);
|
|
||||||
} else if (typeof bytes === 'string') {
|
|
||||||
bytes = Buffer.from(bytes, 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
return crypto.createHash('md5').update(bytes).digest();
|
|
||||||
}
|
|
||||||
|
|
||||||
export default md5;
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export default '00000000-0000-0000-0000-000000000000';
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
import validate from './validate.js';
|
|
||||||
|
|
||||||
function parse(uuid) {
|
|
||||||
if (!validate(uuid)) {
|
|
||||||
throw TypeError('Invalid UUID');
|
|
||||||
}
|
|
||||||
|
|
||||||
let v;
|
|
||||||
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
||||||
|
|
||||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
||||||
arr[1] = v >>> 16 & 0xff;
|
|
||||||
arr[2] = v >>> 8 & 0xff;
|
|
||||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
||||||
|
|
||||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
||||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
||||||
|
|
||||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
||||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
||||||
|
|
||||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
||||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
||||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
||||||
|
|
||||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
||||||
arr[11] = v / 0x100000000 & 0xff;
|
|
||||||
arr[12] = v >>> 24 & 0xff;
|
|
||||||
arr[13] = v >>> 16 & 0xff;
|
|
||||||
arr[14] = v >>> 8 & 0xff;
|
|
||||||
arr[15] = v & 0xff;
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default parse;
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
import crypto from 'crypto';
|
|
||||||
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
|
|
||||||
|
|
||||||
let poolPtr = rnds8Pool.length;
|
|
||||||
export default function rng() {
|
|
||||||
if (poolPtr > rnds8Pool.length - 16) {
|
|
||||||
crypto.randomFillSync(rnds8Pool);
|
|
||||||
poolPtr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
||||||
}
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
import crypto from 'crypto';
|
|
||||||
|
|
||||||
function sha1(bytes) {
|
|
||||||
if (Array.isArray(bytes)) {
|
|
||||||
bytes = Buffer.from(bytes);
|
|
||||||
} else if (typeof bytes === 'string') {
|
|
||||||
bytes = Buffer.from(bytes, 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
return crypto.createHash('sha1').update(bytes).digest();
|
|
||||||
}
|
|
||||||
|
|
||||||
export default sha1;
|
|
||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
import validate from './validate.js';
|
|
||||||
/**
|
|
||||||
* Convert array of 16 byte values to UUID string format of the form:
|
|
||||||
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
||||||
*/
|
|
||||||
|
|
||||||
const byteToHex = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 256; ++i) {
|
|
||||||
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
function stringify(arr, offset = 0) {
|
|
||||||
// Note: Be careful editing this code! It's been tuned for performance
|
|
||||||
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
||||||
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
||||||
// of the following:
|
|
||||||
// - One or more input array values don't map to a hex octet (leading to
|
|
||||||
// "undefined" in the uuid)
|
|
||||||
// - Invalid input values for the RFC `version` or `variant` fields
|
|
||||||
|
|
||||||
if (!validate(uuid)) {
|
|
||||||
throw TypeError('Stringified UUID is invalid');
|
|
||||||
}
|
|
||||||
|
|
||||||
return uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default stringify;
|
|
||||||
-95
@@ -1,95 +0,0 @@
|
|||||||
import rng from './rng.js';
|
|
||||||
import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**
|
|
||||||
//
|
|
||||||
// Inspired by https://github.com/LiosK/UUID.js
|
|
||||||
// and http://docs.python.org/library/uuid.html
|
|
||||||
|
|
||||||
let _nodeId;
|
|
||||||
|
|
||||||
let _clockseq; // Previous uuid creation time
|
|
||||||
|
|
||||||
|
|
||||||
let _lastMSecs = 0;
|
|
||||||
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
|
||||||
|
|
||||||
function v1(options, buf, offset) {
|
|
||||||
let i = buf && offset || 0;
|
|
||||||
const b = buf || new Array(16);
|
|
||||||
options = options || {};
|
|
||||||
let node = options.node || _nodeId;
|
|
||||||
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
|
||||||
// specified. We do this lazily to minimize issues related to insufficient
|
|
||||||
// system entropy. See #189
|
|
||||||
|
|
||||||
if (node == null || clockseq == null) {
|
|
||||||
const seedBytes = options.random || (options.rng || rng)();
|
|
||||||
|
|
||||||
if (node == null) {
|
|
||||||
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
||||||
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clockseq == null) {
|
|
||||||
// Per 4.2.2, randomize (14 bit) clockseq
|
|
||||||
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
||||||
}
|
|
||||||
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
||||||
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
||||||
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
||||||
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
||||||
|
|
||||||
|
|
||||||
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
||||||
// cycle to simulate higher resolution clock
|
|
||||||
|
|
||||||
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
|
||||||
|
|
||||||
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
|
||||||
|
|
||||||
if (dt < 0 && options.clockseq === undefined) {
|
|
||||||
clockseq = clockseq + 1 & 0x3fff;
|
|
||||||
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
||||||
// time interval
|
|
||||||
|
|
||||||
|
|
||||||
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
||||||
nsecs = 0;
|
|
||||||
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
|
||||||
|
|
||||||
|
|
||||||
if (nsecs >= 10000) {
|
|
||||||
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastMSecs = msecs;
|
|
||||||
_lastNSecs = nsecs;
|
|
||||||
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
||||||
|
|
||||||
msecs += 12219292800000; // `time_low`
|
|
||||||
|
|
||||||
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
||||||
b[i++] = tl >>> 24 & 0xff;
|
|
||||||
b[i++] = tl >>> 16 & 0xff;
|
|
||||||
b[i++] = tl >>> 8 & 0xff;
|
|
||||||
b[i++] = tl & 0xff; // `time_mid`
|
|
||||||
|
|
||||||
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
|
||||||
b[i++] = tmh >>> 8 & 0xff;
|
|
||||||
b[i++] = tmh & 0xff; // `time_high_and_version`
|
|
||||||
|
|
||||||
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
||||||
|
|
||||||
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
||||||
|
|
||||||
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
|
||||||
|
|
||||||
b[i++] = clockseq & 0xff; // `node`
|
|
||||||
|
|
||||||
for (let n = 0; n < 6; ++n) {
|
|
||||||
b[i + n] = node[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf || stringify(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default v1;
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
import v35 from './v35.js';
|
|
||||||
import md5 from './md5.js';
|
|
||||||
const v3 = v35('v3', 0x30, md5);
|
|
||||||
export default v3;
|
|
||||||
-64
@@ -1,64 +0,0 @@
|
|||||||
import stringify from './stringify.js';
|
|
||||||
import parse from './parse.js';
|
|
||||||
|
|
||||||
function stringToBytes(str) {
|
|
||||||
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
||||||
|
|
||||||
const bytes = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < str.length; ++i) {
|
|
||||||
bytes.push(str.charCodeAt(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
||||||
export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
||||||
export default function (name, version, hashfunc) {
|
|
||||||
function generateUUID(value, namespace, buf, offset) {
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
value = stringToBytes(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof namespace === 'string') {
|
|
||||||
namespace = parse(namespace);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (namespace.length !== 16) {
|
|
||||||
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
||||||
} // Compute hash of namespace and value, Per 4.3
|
|
||||||
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
||||||
// hashfunc([...namespace, ... value])`
|
|
||||||
|
|
||||||
|
|
||||||
let bytes = new Uint8Array(16 + value.length);
|
|
||||||
bytes.set(namespace);
|
|
||||||
bytes.set(value, namespace.length);
|
|
||||||
bytes = hashfunc(bytes);
|
|
||||||
bytes[6] = bytes[6] & 0x0f | version;
|
|
||||||
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
||||||
|
|
||||||
if (buf) {
|
|
||||||
offset = offset || 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < 16; ++i) {
|
|
||||||
buf[offset + i] = bytes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stringify(bytes);
|
|
||||||
} // Function#name is not settable on some platforms (#270)
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
||||||
} catch (err) {} // For CommonJS default export support
|
|
||||||
|
|
||||||
|
|
||||||
generateUUID.DNS = DNS;
|
|
||||||
generateUUID.URL = URL;
|
|
||||||
return generateUUID;
|
|
||||||
}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
import rng from './rng.js';
|
|
||||||
import stringify from './stringify.js';
|
|
||||||
|
|
||||||
function v4(options, buf, offset) {
|
|
||||||
options = options || {};
|
|
||||||
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
||||||
|
|
||||||
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
||||||
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
||||||
|
|
||||||
if (buf) {
|
|
||||||
offset = offset || 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < 16; ++i) {
|
|
||||||
buf[offset + i] = rnds[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stringify(rnds);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default v4;
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
import v35 from './v35.js';
|
|
||||||
import sha1 from './sha1.js';
|
|
||||||
const v5 = v35('v5', 0x50, sha1);
|
|
||||||
export default v5;
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
import REGEX from './regex.js';
|
|
||||||
|
|
||||||
function validate(uuid) {
|
|
||||||
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default validate;
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
import validate from './validate.js';
|
|
||||||
|
|
||||||
function version(uuid) {
|
|
||||||
if (!validate(uuid)) {
|
|
||||||
throw TypeError('Invalid UUID');
|
|
||||||
}
|
|
||||||
|
|
||||||
return parseInt(uuid.substr(14, 1), 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default version;
|
|
||||||
-79
@@ -1,79 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "v1", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _v.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "v3", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _v2.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "v4", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _v3.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "v5", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _v4.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "NIL", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _nil.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "version", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _version.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "validate", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _validate.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "stringify", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _stringify.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Object.defineProperty(exports, "parse", {
|
|
||||||
enumerable: true,
|
|
||||||
get: function () {
|
|
||||||
return _parse.default;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var _v = _interopRequireDefault(require("./v1.js"));
|
|
||||||
|
|
||||||
var _v2 = _interopRequireDefault(require("./v3.js"));
|
|
||||||
|
|
||||||
var _v3 = _interopRequireDefault(require("./v4.js"));
|
|
||||||
|
|
||||||
var _v4 = _interopRequireDefault(require("./v5.js"));
|
|
||||||
|
|
||||||
var _nil = _interopRequireDefault(require("./nil.js"));
|
|
||||||
|
|
||||||
var _version = _interopRequireDefault(require("./version.js"));
|
|
||||||
|
|
||||||
var _validate = _interopRequireDefault(require("./validate.js"));
|
|
||||||
|
|
||||||
var _stringify = _interopRequireDefault(require("./stringify.js"));
|
|
||||||
|
|
||||||
var _parse = _interopRequireDefault(require("./parse.js"));
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
-223
@@ -1,223 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = void 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Browser-compatible JavaScript MD5
|
|
||||||
*
|
|
||||||
* Modification of JavaScript MD5
|
|
||||||
* https://github.com/blueimp/JavaScript-MD5
|
|
||||||
*
|
|
||||||
* Copyright 2011, Sebastian Tschan
|
|
||||||
* https://blueimp.net
|
|
||||||
*
|
|
||||||
* Licensed under the MIT license:
|
|
||||||
* https://opensource.org/licenses/MIT
|
|
||||||
*
|
|
||||||
* Based on
|
|
||||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
||||||
* Digest Algorithm, as defined in RFC 1321.
|
|
||||||
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
||||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
||||||
* Distributed under the BSD License
|
|
||||||
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
||||||
*/
|
|
||||||
function md5(bytes) {
|
|
||||||
if (typeof bytes === 'string') {
|
|
||||||
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
||||||
|
|
||||||
bytes = new Uint8Array(msg.length);
|
|
||||||
|
|
||||||
for (let i = 0; i < msg.length; ++i) {
|
|
||||||
bytes[i] = msg.charCodeAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Convert an array of little-endian words to an array of bytes
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function md5ToHexEncodedArray(input) {
|
|
||||||
const output = [];
|
|
||||||
const length32 = input.length * 32;
|
|
||||||
const hexTab = '0123456789abcdef';
|
|
||||||
|
|
||||||
for (let i = 0; i < length32; i += 8) {
|
|
||||||
const x = input[i >> 5] >>> i % 32 & 0xff;
|
|
||||||
const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
|
||||||
output.push(hex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Calculate output length with padding and bit length
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function getOutputLength(inputLength8) {
|
|
||||||
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function wordsToMd5(x, len) {
|
|
||||||
/* append padding */
|
|
||||||
x[len >> 5] |= 0x80 << len % 32;
|
|
||||||
x[getOutputLength(len) - 1] = len;
|
|
||||||
let a = 1732584193;
|
|
||||||
let b = -271733879;
|
|
||||||
let c = -1732584194;
|
|
||||||
let d = 271733878;
|
|
||||||
|
|
||||||
for (let i = 0; i < x.length; i += 16) {
|
|
||||||
const olda = a;
|
|
||||||
const oldb = b;
|
|
||||||
const oldc = c;
|
|
||||||
const oldd = d;
|
|
||||||
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
||||||
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
||||||
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
||||||
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
||||||
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
||||||
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
||||||
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
||||||
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
||||||
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
||||||
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
||||||
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
||||||
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
||||||
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
||||||
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
||||||
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
||||||
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
||||||
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
||||||
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
||||||
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
||||||
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
||||||
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
||||||
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
||||||
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
||||||
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
||||||
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
||||||
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
||||||
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
||||||
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
||||||
a = safeAdd(a, olda);
|
|
||||||
b = safeAdd(b, oldb);
|
|
||||||
c = safeAdd(c, oldc);
|
|
||||||
d = safeAdd(d, oldd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [a, b, c, d];
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Convert an array bytes to an array of little-endian words
|
|
||||||
* Characters >255 have their high-byte silently ignored.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function bytesToWords(input) {
|
|
||||||
if (input.length === 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const length8 = input.length * 8;
|
|
||||||
const output = new Uint32Array(getOutputLength(length8));
|
|
||||||
|
|
||||||
for (let i = 0; i < length8; i += 8) {
|
|
||||||
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
||||||
* to work around bugs in some JS interpreters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function safeAdd(x, y) {
|
|
||||||
const lsw = (x & 0xffff) + (y & 0xffff);
|
|
||||||
const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
||||||
return msw << 16 | lsw & 0xffff;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Bitwise rotate a 32-bit number to the left.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function bitRotateLeft(num, cnt) {
|
|
||||||
return num << cnt | num >>> 32 - cnt;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* These functions implement the four basic operations the algorithm uses.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function md5cmn(q, a, b, x, s, t) {
|
|
||||||
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5ff(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5gg(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5hh(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function md5ii(a, b, c, d, x, s, t) {
|
|
||||||
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
var _default = md5;
|
|
||||||
exports.default = _default;
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = void 0;
|
|
||||||
|
|
||||||
var _crypto = _interopRequireDefault(require("crypto"));
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
function md5(bytes) {
|
|
||||||
if (Array.isArray(bytes)) {
|
|
||||||
bytes = Buffer.from(bytes);
|
|
||||||
} else if (typeof bytes === 'string') {
|
|
||||||
bytes = Buffer.from(bytes, 'utf8');
|
|
||||||
}
|
|
||||||
|
|
||||||
return _crypto.default.createHash('md5').update(bytes).digest();
|
|
||||||
}
|
|
||||||
|
|
||||||
var _default = md5;
|
|
||||||
exports.default = _default;
|
|
||||||
-8
@@ -1,8 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = void 0;
|
|
||||||
var _default = '00000000-0000-0000-0000-000000000000';
|
|
||||||
exports.default = _default;
|
|
||||||
-45
@@ -1,45 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = void 0;
|
|
||||||
|
|
||||||
var _validate = _interopRequireDefault(require("./validate.js"));
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
function parse(uuid) {
|
|
||||||
if (!(0, _validate.default)(uuid)) {
|
|
||||||
throw TypeError('Invalid UUID');
|
|
||||||
}
|
|
||||||
|
|
||||||
let v;
|
|
||||||
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
||||||
|
|
||||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
||||||
arr[1] = v >>> 16 & 0xff;
|
|
||||||
arr[2] = v >>> 8 & 0xff;
|
|
||||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
||||||
|
|
||||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
||||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
||||||
|
|
||||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
||||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
||||||
|
|
||||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
||||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
||||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
||||||
|
|
||||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
||||||
arr[11] = v / 0x100000000 & 0xff;
|
|
||||||
arr[12] = v >>> 24 & 0xff;
|
|
||||||
arr[13] = v >>> 16 & 0xff;
|
|
||||||
arr[14] = v >>> 8 & 0xff;
|
|
||||||
arr[15] = v & 0xff;
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
var _default = parse;
|
|
||||||
exports.default = _default;
|
|
||||||
-8
@@ -1,8 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = void 0;
|
|
||||||
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
||||||
exports.default = _default;
|
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = rng;
|
|
||||||
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
||||||
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
||||||
// generators (like Math.random()).
|
|
||||||
let getRandomValues;
|
|
||||||
const rnds8 = new Uint8Array(16);
|
|
||||||
|
|
||||||
function rng() {
|
|
||||||
// lazy load so that environments that need to polyfill have a chance to do so
|
|
||||||
if (!getRandomValues) {
|
|
||||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
||||||
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
||||||
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
||||||
|
|
||||||
if (!getRandomValues) {
|
|
||||||
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return getRandomValues(rnds8);
|
|
||||||
}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = rng;
|
|
||||||
|
|
||||||
var _crypto = _interopRequireDefault(require("crypto"));
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
|
|
||||||
|
|
||||||
let poolPtr = rnds8Pool.length;
|
|
||||||
|
|
||||||
function rng() {
|
|
||||||
if (poolPtr > rnds8Pool.length - 16) {
|
|
||||||
_crypto.default.randomFillSync(rnds8Pool);
|
|
||||||
|
|
||||||
poolPtr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
||||||
}
|
|
||||||
-104
@@ -1,104 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
|
||||||
value: true
|
|
||||||
});
|
|
||||||
exports.default = void 0;
|
|
||||||
|
|
||||||
// Adapted from Chris Veness' SHA1 code at
|
|
||||||
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
||||||
function f(s, x, y, z) {
|
|
||||||
switch (s) {
|
|
||||||
case 0:
|
|
||||||
return x & y ^ ~x & z;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
return x ^ y ^ z;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return x & y ^ x & z ^ y & z;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return x ^ y ^ z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ROTL(x, n) {
|
|
||||||
return x << n | x >>> 32 - n;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sha1(bytes) {
|
|
||||||
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
||||||
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
||||||
|
|
||||||
if (typeof bytes === 'string') {
|
|
||||||
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
||||||
|
|
||||||
bytes = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < msg.length; ++i) {
|
|
||||||
bytes.push(msg.charCodeAt(i));
|
|
||||||
}
|
|
||||||
} else if (!Array.isArray(bytes)) {
|
|
||||||
// Convert Array-like to Array
|
|
||||||
bytes = Array.prototype.slice.call(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
bytes.push(0x80);
|
|
||||||
const l = bytes.length / 4 + 2;
|
|
||||||
const N = Math.ceil(l / 16);
|
|
||||||
const M = new Array(N);
|
|
||||||
|
|
||||||
for (let i = 0; i < N; ++i) {
|
|
||||||
const arr = new Uint32Array(16);
|
|
||||||
|
|
||||||
for (let j = 0; j < 16; ++j) {
|
|
||||||
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
||||||
}
|
|
||||||
|
|
||||||
M[i] = arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
||||||
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
||||||
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
||||||
|
|
||||||
for (let i = 0; i < N; ++i) {
|
|
||||||
const W = new Uint32Array(80);
|
|
||||||
|
|
||||||
for (let t = 0; t < 16; ++t) {
|
|
||||||
W[t] = M[i][t];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let t = 16; t < 80; ++t) {
|
|
||||||
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
let a = H[0];
|
|
||||||
let b = H[1];
|
|
||||||
let c = H[2];
|
|
||||||
let d = H[3];
|
|
||||||
let e = H[4];
|
|
||||||
|
|
||||||
for (let t = 0; t < 80; ++t) {
|
|
||||||
const s = Math.floor(t / 20);
|
|
||||||
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
||||||
e = d;
|
|
||||||
d = c;
|
|
||||||
c = ROTL(b, 30) >>> 0;
|
|
||||||
b = a;
|
|
||||||
a = T;
|
|
||||||
}
|
|
||||||
|
|
||||||
H[0] = H[0] + a >>> 0;
|
|
||||||
H[1] = H[1] + b >>> 0;
|
|
||||||
H[2] = H[2] + c >>> 0;
|
|
||||||
H[3] = H[3] + d >>> 0;
|
|
||||||
H[4] = H[4] + e >>> 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
||||||
}
|
|
||||||
|
|
||||||
var _default = sha1;
|
|
||||||
exports.default = _default;
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user