diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 3a3cce5..77c0a3c 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -7,5 +7,6 @@ version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
+ target-branch: "beta"
schedule:
interval: "weekly"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 198318b..914167b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,3 +38,5 @@ jobs:
npm run format:check
npm run lint
npm run build
+ npm ln
+ golem-sdk --version
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..4833e34
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,82 @@
+name: Release Pipeline
+
+on:
+ push:
+ branches:
+ # Regular release channels
+ - master
+ - next
+ - beta
+ - alpha
+ # Support, hotfix branches like: 1.0.x or 1.x
+ - '([0-9]+)(\.([0-9]+))?\.x'
+
+ # Allows triggering the workflow manually
+ workflow_dispatch:
+
+# We're going to interact with GH from the pipelines, so we need to get some permissions
+permissions:
+ contents: read # for checkout
+
+jobs:
+ regular-checks:
+ name: Build and unit-test on supported platforms and NodeJS versions
+ strategy:
+ matrix:
+ node-version: [16.x, 18.x, 20.x]
+ os: [ubuntu-latest, windows-latest, macos-latest]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup NodeJS ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Perform regular checks
+ run: |
+ npm install
+ npm run format:check
+ npm run lint
+ npm run build
+ npm ln
+ golem-sdk --version
+
+ release:
+ name: Release to NPM and GitHub
+ needs: regular-checks
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write # to be able to publish a GitHub release
+ issues: write # to be able to comment on released issues
+ pull-requests: write # to be able to comment on released pull requests
+ id-token: write # to enable use of OIDC for npm provenance
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Setup NodeJS
+ uses: actions/setup-node@v3
+ with:
+ # Semantic release requires this as bare minimum
+ node-version: 18
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
+ run: npm audit signatures
+
+ - name: Build the SDK for release
+ run: npm run build
+
+ - name: Release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ run: npx semantic-release
diff --git a/.gitignore b/.gitignore
index ab12063..ca2e733 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,8 @@ dist/
.vscode/
.DS_Store
-manifest.json
\ No newline at end of file
+manifest.json
+*.sig
+
+data/project-templates/**/package-lock.json
+data/project-templates/**/node_modules
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..ad30dac
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,6 @@
+.*
+tsconfig.json
+node_modules/
+data/**/package-lock.json
+data/**/node_modules/
+src/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e72bfdd
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ 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.
+
+
+ Copyright (C)
+
+ 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 .
+
+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:
+
+ Copyright (C)
+ 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
+.
+
+ 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
+.
\ No newline at end of file
diff --git a/README.md b/README.md
index d37a903..7a81488 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,183 @@
# Golem SDK CLI
-## About
+Golem SDK CLI is a companion tool for the [Golem SDK](https://github.com/golemfactory/golem-js). It accelerates the creation and management of Golem JS projects.
-Golem SDK CLI is a command line interface supporting development of applications using [Golem JS](https://github.com/golemfactory/golem-js)
+## Installing / Getting started
-## Installation
+Golem SDK CLI is available as an NPM package.
-@golem-sdk/cli is available as a NPM package.
+Install using npm:
-You can install it through npm:
+```shell
+npm install -g @golem-sdk/cli
+```
+
+Install using yarn:
-```bash
-npm install @golem-js/cli
+```shell
+yarn global add @golem-sdk/cli
```
-or by yarn:
+To check if the installation was successful, run:
-```bash
-yarn add @golem-js/cli
+```shell
+golem-sdk --version
```
-## Usage
+After installation, the CLI is ready to be used.
+
+## Developing
-```bash
-golem-sdk --help
+If you want to install from source code or you would like to develop Golem SDK CLI, you can clone the repository and install dependencies:
+
+```shell
+git clone git@github.com:golemfactory/golem-sdk-cli.git
+cd golem-sdk-cli/
+npm install
```
+
+### Building
+
+To build the CLI, run:
+
+```shell
+npm run build
+```
+
+To make the CLI available in your system, run:
+
+```shell
+npm link
+```
+
+Now, the `golem-sdk` command should be available in your system.
+
+## Features
+
+Golem SDK CLI is a companion tool for the [Golem SDK](https://github.com/golemfactory/golem-js). It is developed in parallel with the SDK, and new features are added as the SDK evolves or new use cases emerge
+
+If you see a feature missing or a possible Golem SDK user experience improvement we could implement, please open an issue or a pull request.
+
+### Golem Manifest
+
+[Golem Manifest](https://docs.golem.network/docs/golem/payload-manifest) is a JSON document that describes your Golem application. While it is not necessary for simple applications, you will need it if you want to access advanced features of the Golem SDK, like access to the Internet (outbound).
+
+The `golem-sdk` CLI allows users to create and update the manifest file. By default, it assumes the manifest is available in a `manifest.json` file in the current folder. If you want to point to a different file, use the --manifest (or -m) option.
+
+### Creating a Golem Manifest
+
+To create a new Golem Manifest with the `golem-sdk` CLI, run:
+
+```shell
+golem-sdk manifest create [--image-hash hash]
+```
+
+The `image` argument should identify the GVMI image used by your application. The tools accept a few formats which are explained in the table below. You can learn more about Golem images [here](https://docs.golem.network/docs/creators/javascript/guides/golem-images).
+
+If you have a `package.json` file in your project, the tool will use the `name`, `version`, and `description` fields from the file to fill in the fields in the manifest. Otherwise, you will need to provide them manually.
+
+#### Image
+
+The manifest needs to contain the image URL pointing to the GVMI download location and its hash to validate its integrity.
+To facilitate the process of creating a manifest, `golem-sdk` accepts multiple forms of image argument, where some of them will automatically resolve the URL and/or hash.
+Please consult the table below for more details:
+
+| Argument format | Example | Is `--image-hash` required? | Notes |
+| ---------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------ |
+| Image tag | `golem/node:latest` | No, it will be automatically resolved. | Image hash is fetched from [https://registry.golem.network]. It is the recommended method. |
+| Image hash | `3d6c48bb4c192708168d53cee4f36876b263b7745c3a3c239c6749cd` | No, it is resolved from the image argument. | Image URL will point to [https://registry.golem.network] |
+| URL to registry.golem.network | `https://registry.golem.network/v1/image/download?tag=golem-examples/blender:2.80&https=true` | No, it is automatically resolved. | |
+| URL to arbitrary download location | `https://example.com/my-image` | Yes, image-hash is required. | Image is calculated by the gvmkit-build conversion tool. |
+
+If the hash is not provided or resolved, you will get a warning that the manifest will not be usable until you provide it manually.
+
+### Adding outbound URLs
+
+For your application to access the Internet from the Golem network, the manifest must include the outbound URLs the application will be using.
+
+The default set of URLs that providers may allow your application to use is available ([here](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist)). Note providers can modify the content of the list.
+
+#### Example: Simple use
+
+This command will update the manifest file with the provided URL:
+
+```shell
+golem-sdk manifest net add-outbound https://golem.network
+```
+
+You can use this command multiple times to add additional URLs to the manifest or pass many URLs in a single run:
+
+#### Example: Multiple URLs
+
+This command will update the manifest file with all the URLs provided.
+
+```shell
+golem-sdk manifest net add-outbound https://golem.network https://github.com https://example.com
+```
+
+### Signing the manifest
+
+If the provider has set up an audited-payload rule for URLs not on the whitelist, you can gain access to these URLs. However, they must be declared in the manifest, and the manifest is signed by the key linked with the certificate accepted by the provider.
+
+To sign the manifest, run:
+
+```shell
+golem-sdk manifest sign -k
+```
+
+If your private key is encrypted, you will need to provide the correct passphrase (`-p` or `--passphrase` option).
+This command will produce a signature file (by default `manifest.sig`) that you will need to use in your application.
+
+### Verifying the signature
+
+You can verify the manifest signature with your certificate using the following command:
+
+```shell
+golem-sdk manifest verify
+```
+
+By default, it will use `manifest.pem` as the certificate file and `manifest.sig` as the signature file. You can change that by using the `--certificate-file` and `--signature-file` options.
+
+On success, it will print the following message:
+
+```
+Manifest matches signature.
+```
+
+It is important to use this command to make sure the key you are using is compatible with your certificate.
+
+## Contributing
+
+If you'd like to contribute to the project, you can fork the repository and create a Pull Request.
+Code contributions are warmly welcomed.
+
+Please make sure the code follows the coding style as configured in `.eslintrc` and `.prettierrc`.
+
+The Pull Request should describe what changes you've made, what's the purpose of them and how to use them.
+
+## Links
+
+- Project homepage: https://github.com/golemfactory/golem-sdk-cli
+- Repository: https://github.com/golemfactory/golem-sdk-cli
+- Issue tracker: https://github.com/golemfactory/golem-sdk-cli/issues
+ - In case of sensitive bugs like security vulnerabilities, please contact
+ us directly through our [contact form](https://www.golem.network/contact-form) instead of using the issue tracker.
+ We value your effort to improve the security and privacy of this project!
+- [Golem](https://golem.network), a global, open-source, decentralized supercomputer that anyone can access.
+- [Golem Image Registry](https://registry.golem.network)
+- [Golem Discord](https://chat.golem.network)
+- Documentation:
+ - [QuickStart](https://docs.golem.network/docs/creators/javascript/quickstarts) for JavaScript developers
+ - Have a look at the most important concepts behind any Golem
+ application: [Golem application fundamentals](https://handbook.golem.network/requestor-tutorials/golem-application-fundamentals)
+ - Learn about preparing your custom Docker-like [images](https://docs.golem.network/docs/creators/javascript/tutorials/building-custom-image).
+- Related projects:
+ - [Golem SDK](https://github.com/golemfactory/golem-js) - Typescript + NodeJS API for Golem.
+ - [Yagna](https://github.com/golemfactory/yagna) - An open platform and marketplace for distributed computations.
+ - [yapapi](https://github.com/golemfactory/yapapi) - Python high-level API for Golem.
+
+## Licensing
+
+The code in this project is licensed under the GPL-3 license.
+
+See [LICENSE](LICENSE) for more information.
diff --git a/data/project-templates/js-node/package.json b/data/project-templates/js-node/package.json
new file mode 100644
index 0000000..79e5e37
--- /dev/null
+++ b/data/project-templates/js-node/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "nodejs-golem-app",
+ "version": "1.0.0",
+ "description": "NodeJS script using Golem Network",
+ "main": "src/index.js",
+ "type": "module",
+ "scripts": {
+ "run": "node src/index.js",
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "keywords": [
+ "golem",
+ "network",
+ "application"
+ ],
+ "dependencies": {
+ "@golem-sdk/golem-js": "^0.11.2",
+ "dotenv": "^16.3.1"
+ },
+ "devDependencies": {
+ "@golem-sdk/cli": "^1.0.0-beta.1"
+ }
+}
diff --git a/data/project-templates/js-node/src/index.js b/data/project-templates/js-node/src/index.js
new file mode 100644
index 0000000..d45ac05
--- /dev/null
+++ b/data/project-templates/js-node/src/index.js
@@ -0,0 +1,39 @@
+import * as dotenv from "dotenv";
+import { LogLevel, ProposalFilters, TaskExecutor } from "@golem-sdk/golem-js";
+
+dotenv.config();
+
+(async function main() {
+ const executor = await TaskExecutor.create({
+ // What do you want to run
+ package: "golem/node:20-alpine",
+
+ // How much you wish to spend
+ budget: 0.5,
+ proposalFilter: ProposalFilters.limitPriceFilter({
+ start: 0.1,
+ cpuPerSec: 0.1 / 3600,
+ envPerSec: 0.1 / 3600,
+ }),
+
+ // Where you want to spend
+ payment: {
+ network: "polygon",
+ },
+
+ // Control the execution of tasks
+ maxTaskRetries: 0,
+
+ // Useful for debugging
+ logLevel: LogLevel.Info,
+ taskTimeout: 5 * 60 * 1000,
+ });
+
+ try {
+ // Your code goes here
+ } catch (err) {
+ console.error("Running the task on Golem failed due to", err);
+ } finally {
+ await executor.end();
+ }
+})();
diff --git a/package-lock.json b/package-lock.json
index 910c546..57133a4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,20 +1,21 @@
{
"name": "@golem-sdk/cli",
- "version": "0.1.0",
+ "version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@golem-sdk/cli",
- "version": "0.1.0",
- "license": "LGPL-3.0",
+ "version": "1.0.0",
+ "license": "GPL-3.0",
"dependencies": {
- "@golem-sdk/golem-js": "^0.10.1",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"commander": "^11.0.0",
+ "enquirer": "^2.4.1",
"lodash": "^4.17.21",
"luxon": "^3.4.3",
+ "new-find-package-json": "^2.0.0",
"node-fetch": "^2.7.0",
"typescript": "^5.2.2"
},
@@ -1100,41 +1101,18 @@
"dev": true
},
"node_modules/@eslint/js": {
- "version": "8.48.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz",
- "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==",
+ "version": "8.49.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz",
+ "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
- "node_modules/@golem-sdk/golem-js": {
- "version": "0.10.1",
- "resolved": "https://registry.npmjs.org/@golem-sdk/golem-js/-/golem-js-0.10.1.tgz",
- "integrity": "sha512-HJ2AMqKeNr4dUXTSdnfaG9WxgW2tfL/7e8Xz5db4WfAmC6eg0wE5vM9qHJwuK/R5lqGjCytSROBdS6RuukCOdg==",
- "dependencies": {
- "@rauschma/stringio": "^1.4.0",
- "axios": "^1.1.3",
- "bottleneck": "^2.19.5",
- "collect.js": "^4.34.3",
- "eventsource": "^2.0.2",
- "flatbuffers": "^23.5.26",
- "ip-num": "^1.4.1",
- "js-sha3": "^0.9.1",
- "pino": "^8.11.0",
- "pino-pretty": "^10.0.1",
- "tmp": "^0.2.1",
- "uuid": "^9.0.0",
- "ya-ts-client": "^0.5.3"
- },
- "engines": {
- "node": ">=16.0.0"
- }
- },
"node_modules/@humanwhocodes/config-array": {
- "version": "0.11.10",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz",
- "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==",
+ "version": "0.11.11",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz",
+ "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==",
"dev": true,
"dependencies": {
"@humanwhocodes/object-schema": "^1.2.1",
@@ -1852,19 +1830,6 @@
"node": ">=12"
}
},
- "node_modules/@rauschma/stringio": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.4.0.tgz",
- "integrity": "sha512-3uor2f/MXZkmX5RJf8r+OC3WvZVzpSme0yyL0rQDPEnatE02qRcqwEwnsgpgriEck0S/n4vWtUd6tTtrJwk45Q==",
- "dependencies": {
- "@types/node": "^10.0.3"
- }
- },
- "node_modules/@rauschma/stringio/node_modules/@types/node": {
- "version": "10.17.60",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
- "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
- },
"node_modules/@semantic-release/commit-analyzer": {
"version": "10.0.4",
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-10.0.4.tgz",
@@ -2738,9 +2703,9 @@
"dev": true
},
"node_modules/@types/lodash": {
- "version": "4.14.197",
- "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz",
- "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==",
+ "version": "4.14.198",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.198.tgz",
+ "integrity": "sha512-trNJ/vtMZYMLhfN45uLq4ShQSw0/S7xCTLLVM+WM1rmFpba/VS42jVUgaO3w/NOLiWR/09lnYk0yMaA/atdIsg==",
"dev": true
},
"node_modules/@types/luxon": {
@@ -2854,15 +2819,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "6.4.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz",
- "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==",
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.0.tgz",
+ "integrity": "sha512-jZKYwqNpNm5kzPVP5z1JXAuxjtl2uG+5NpaMocFPTNC2EdYIgbXIPImObOkhbONxtFTTdoZstLZefbaK+wXZng==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "6.4.1",
- "@typescript-eslint/types": "6.4.1",
- "@typescript-eslint/typescript-estree": "6.4.1",
- "@typescript-eslint/visitor-keys": "6.4.1",
+ "@typescript-eslint/scope-manager": "6.7.0",
+ "@typescript-eslint/types": "6.7.0",
+ "@typescript-eslint/typescript-estree": "6.7.0",
+ "@typescript-eslint/visitor-keys": "6.7.0",
"debug": "^4.3.4"
},
"engines": {
@@ -2881,6 +2846,80 @@
}
}
},
+ "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz",
+ "integrity": "sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "6.7.0",
+ "@typescript-eslint/visitor-keys": "6.7.0"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.0.tgz",
+ "integrity": "sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q==",
+ "dev": true,
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz",
+ "integrity": "sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "6.7.0",
+ "@typescript-eslint/visitor-keys": "6.7.0",
+ "debug": "^4.3.4",
+ "globby": "^11.1.0",
+ "is-glob": "^4.0.3",
+ "semver": "^7.5.4",
+ "ts-api-utils": "^1.0.1"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz",
+ "integrity": "sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "6.7.0",
+ "eslint-visitor-keys": "^3.4.1"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
"node_modules/@typescript-eslint/scope-manager": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz",
@@ -3007,17 +3046,6 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
- "node_modules/abort-controller": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
- "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
- "dependencies": {
- "event-target-shim": "^5.0.0"
- },
- "engines": {
- "node": ">=6.5"
- }
- },
"node_modules/acorn": {
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz",
@@ -3119,6 +3147,14 @@
}
}
},
+ "node_modules/ansi-colors": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
+ "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/ansi-escapes": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
@@ -3150,7 +3186,6 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true,
"engines": {
"node": ">=8"
}
@@ -3234,25 +3269,8 @@
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
- },
- "node_modules/atomic-sleep": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
- "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==",
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/axios": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz",
- "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==",
- "dependencies": {
- "follow-redirects": "^1.15.0",
- "form-data": "^4.0.0",
- "proxy-from-env": "^1.1.0"
- }
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+ "dev": true
},
"node_modules/babel-jest": {
"version": "29.6.4",
@@ -3373,26 +3391,8 @@
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
- },
- "node_modules/base64-js": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
},
"node_modules/before-after-hook": {
"version": "2.2.3",
@@ -3403,12 +3403,14 @@
"node_modules/bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
- "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
+ "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==",
+ "dev": true
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -3467,29 +3469,6 @@
"node-int64": "^0.4.0"
}
},
- "node_modules/buffer": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
- "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "base64-js": "^1.3.1",
- "ieee754": "^1.2.1"
- }
- },
"node_modules/buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
@@ -3682,11 +3661,6 @@
"integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==",
"dev": true
},
- "node_modules/collect.js": {
- "version": "4.36.1",
- "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.36.1.tgz",
- "integrity": "sha512-jd97xWPKgHn6uvK31V6zcyPd40lUJd7gpYxbN2VOVxGWO4tyvS9Li4EpsFjXepGTo2tYcOTC4a8YsbQXMJ4XUw=="
- },
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -3705,15 +3679,11 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
- "node_modules/colorette": {
- "version": "2.0.20",
- "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
- "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
- },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
"dependencies": {
"delayed-stream": "~1.0.0"
},
@@ -3742,7 +3712,8 @@
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+ "dev": true
},
"node_modules/config-chain": {
"version": "1.1.13",
@@ -3971,19 +3942,10 @@
"node": ">=8"
}
},
- "node_modules/dateformat": {
- "version": "4.6.3",
- "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
- "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
- "engines": {
- "node": "*"
- }
- },
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
- "dev": true,
"dependencies": {
"ms": "2.1.2"
},
@@ -4072,6 +4034,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "dev": true,
"engines": {
"node": ">=0.4.0"
}
@@ -4208,12 +4171,16 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
- "node_modules/end-of-stream": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
- "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "node_modules/enquirer": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz",
+ "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==",
"dependencies": {
- "once": "^1.4.0"
+ "ansi-colors": "^4.1.1",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8.6"
}
},
"node_modules/env-ci": {
@@ -4370,16 +4337,16 @@
}
},
"node_modules/eslint": {
- "version": "8.48.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz",
- "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==",
+ "version": "8.49.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz",
+ "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.2",
- "@eslint/js": "8.48.0",
- "@humanwhocodes/config-array": "^0.11.10",
+ "@eslint/js": "8.49.0",
+ "@humanwhocodes/config-array": "^0.11.11",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
"ajv": "^6.12.4",
@@ -4557,30 +4524,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/event-target-shim": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
- "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/events": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
- "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
- "engines": {
- "node": ">=0.8.x"
- }
- },
- "node_modules/eventsource": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz",
- "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==",
- "engines": {
- "node": ">=12.0.0"
- }
- },
"node_modules/execa": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
@@ -4629,11 +4572,6 @@
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
- "node_modules/fast-copy": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.1.tgz",
- "integrity": "sha512-Knr7NOtK3HWRYGtHoJrjkaWepqT8thIVGAwt0p0aUs1zqkAzXZV4vo9fFNwyb5fcqK1GKYFYxldQdIDVKhUAfA=="
- },
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -4679,19 +4617,6 @@
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true
},
- "node_modules/fast-redact": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz",
- "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/fast-safe-stringify": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
- "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
- },
"node_modules/fastq": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
@@ -4806,49 +4731,12 @@
"node": "^10.12.0 || >=12.0.0"
}
},
- "node_modules/flatbuffers": {
- "version": "23.5.26",
- "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-23.5.26.tgz",
- "integrity": "sha512-vE+SI9vrJDwi1oETtTIFldC/o9GsVKRM+s6EL0nQgxXlYV1Vc4Tk30hj4xGICftInKQKj1F3up2n8UbIVobISQ=="
- },
"node_modules/flatted": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
"dev": true
},
- "node_modules/follow-redirects": {
- "version": "1.15.2",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
- "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
- "funding": [
- {
- "type": "individual",
- "url": "https://github.com/sponsors/RubenVerborgh"
- }
- ],
- "engines": {
- "node": ">=4.0"
- },
- "peerDependenciesMeta": {
- "debug": {
- "optional": true
- }
- }
- },
- "node_modules/form-data": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
- "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
- "dependencies": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/from2": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
@@ -4906,7 +4794,8 @@
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
+ "dev": true
},
"node_modules/fsevents": {
"version": "2.3.3",
@@ -5076,6 +4965,7 @@
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -5213,65 +5103,6 @@
"node": ">=8"
}
},
- "node_modules/help-me": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/help-me/-/help-me-4.2.0.tgz",
- "integrity": "sha512-TAOnTB8Tz5Dw8penUuzHVrKNKlCIbwwbHnXraNJxPwf8LRtE2HlM84RYuezMFcwOJmoYOCWVDyJ8TQGxn9PgxA==",
- "dependencies": {
- "glob": "^8.0.0",
- "readable-stream": "^3.6.0"
- }
- },
- "node_modules/help-me/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/help-me/node_modules/glob": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
- "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^5.0.1",
- "once": "^1.3.0"
- },
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/help-me/node_modules/minimatch": {
- "version": "5.1.6",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
- "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/help-me/node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/hook-std": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz",
@@ -5370,25 +5201,6 @@
"url": "https://github.com/sponsors/typicode"
}
},
- "node_modules/ieee754": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
- "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
"node_modules/ignore": {
"version": "5.2.4",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
@@ -5467,6 +5279,7 @@
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "dev": true,
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
@@ -5475,7 +5288,8 @@
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true
},
"node_modules/ini": {
"version": "1.3.8",
@@ -5499,11 +5313,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/ip-num": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/ip-num/-/ip-num-1.5.1.tgz",
- "integrity": "sha512-QziFxgxq3mjIf5CuwlzXFYscHxgLqdEdJKRo2UJ5GurL5zrSRMzT/O+nK0ABimoFH8MWF8YwIiwECYsHc1LpUQ=="
- },
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
@@ -6301,19 +6110,6 @@
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
- "node_modules/joycon": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
- "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/js-sha3": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.9.1.tgz",
- "integrity": "sha512-BEtdfjzc2zf276Ck8FprMl0ej0rFrK3TSwNSzFjDvv/QOj2YlWmoRBOIZaaUHFWJAXHl2KfiwVBIbYYeHHtCNA=="
- },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -6841,6 +6637,7 @@
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "dev": true,
"engines": {
"node": ">= 0.6"
}
@@ -6849,6 +6646,7 @@
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dev": true,
"dependencies": {
"mime-db": "1.52.0"
},
@@ -6878,6 +6676,7 @@
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
"dependencies": {
"brace-expansion": "^1.1.7"
},
@@ -6889,6 +6688,7 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -6919,8 +6719,7 @@
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/natural-compare": {
"version": "1.4.0",
@@ -6940,6 +6739,17 @@
"integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==",
"dev": true
},
+ "node_modules/new-find-package-json": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/new-find-package-json/-/new-find-package-json-2.0.0.tgz",
+ "integrity": "sha512-lDcBsjBSMlj3LXH2v/FW3txlh2pYTjmbOXPYJD93HI5EwuLzI11tdHSIpUMmfq/IOsldj4Ps8M8flhm+pCK4Ew==",
+ "dependencies": {
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": ">=12.22.0"
+ }
+ },
"node_modules/node-emoji": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz",
@@ -10144,15 +9954,11 @@
"inBundle": true,
"license": "ISC"
},
- "node_modules/on-exit-leak-free": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz",
- "integrity": "sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w=="
- },
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dev": true,
"dependencies": {
"wrappy": "1"
}
@@ -10334,6 +10140,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+ "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -10389,65 +10196,6 @@
"node": ">=4"
}
},
- "node_modules/pino": {
- "version": "8.15.0",
- "resolved": "https://registry.npmjs.org/pino/-/pino-8.15.0.tgz",
- "integrity": "sha512-olUADJByk4twxccmAxb1RiGKOSvddHugCV3wkqjyv+3Sooa2KLrmXrKEWOKi0XPCLasRR5jBXxioE1jxUa4KzQ==",
- "dependencies": {
- "atomic-sleep": "^1.0.0",
- "fast-redact": "^3.1.1",
- "on-exit-leak-free": "^2.1.0",
- "pino-abstract-transport": "v1.0.0",
- "pino-std-serializers": "^6.0.0",
- "process-warning": "^2.0.0",
- "quick-format-unescaped": "^4.0.3",
- "real-require": "^0.2.0",
- "safe-stable-stringify": "^2.3.1",
- "sonic-boom": "^3.1.0",
- "thread-stream": "^2.0.0"
- },
- "bin": {
- "pino": "bin.js"
- }
- },
- "node_modules/pino-abstract-transport": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.0.0.tgz",
- "integrity": "sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA==",
- "dependencies": {
- "readable-stream": "^4.0.0",
- "split2": "^4.0.0"
- }
- },
- "node_modules/pino-pretty": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-10.2.0.tgz",
- "integrity": "sha512-tRvpyEmGtc2D+Lr3FulIZ+R1baggQ4S3xD2Ar93KixFEDx6SEAUP3W5aYuEw1C73d6ROrNcB2IXLteW8itlwhA==",
- "dependencies": {
- "colorette": "^2.0.7",
- "dateformat": "^4.6.3",
- "fast-copy": "^3.0.0",
- "fast-safe-stringify": "^2.1.1",
- "help-me": "^4.0.1",
- "joycon": "^3.1.1",
- "minimist": "^1.2.6",
- "on-exit-leak-free": "^2.1.0",
- "pino-abstract-transport": "^1.0.0",
- "pump": "^3.0.0",
- "readable-stream": "^4.0.0",
- "secure-json-parse": "^2.4.0",
- "sonic-boom": "^3.0.0",
- "strip-json-comments": "^3.1.1"
- },
- "bin": {
- "pino-pretty": "bin.js"
- }
- },
- "node_modules/pino-std-serializers": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz",
- "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA=="
- },
"node_modules/pirates": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz",
@@ -10611,9 +10359,9 @@
}
},
"node_modules/prettier": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz",
- "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
+ "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
@@ -10651,25 +10399,12 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "node_modules/process": {
- "version": "0.11.10",
- "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
- "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
- "engines": {
- "node": ">= 0.6.0"
- }
- },
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true
},
- "node_modules/process-warning": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.2.0.tgz",
- "integrity": "sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg=="
- },
"node_modules/prompts": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
@@ -10689,20 +10424,6 @@
"integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==",
"dev": true
},
- "node_modules/proxy-from-env": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
- },
- "node_modules/pump": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
- "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
- "dependencies": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
"node_modules/punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
@@ -10747,11 +10468,6 @@
}
]
},
- "node_modules/quick-format-unescaped": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
- "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
- },
"node_modules/quick-lru": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz",
@@ -10920,29 +10636,6 @@
"node": ">=8"
}
},
- "node_modules/readable-stream": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz",
- "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==",
- "dependencies": {
- "abort-controller": "^3.0.0",
- "buffer": "^6.0.3",
- "events": "^3.3.0",
- "process": "^0.11.10",
- "string_decoder": "^1.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/real-require": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
- "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==",
- "engines": {
- "node": ">= 12.13.0"
- }
- },
"node_modules/redent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
@@ -11076,6 +10769,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "dev": true,
"dependencies": {
"glob": "^7.1.3"
},
@@ -11113,6 +10807,7 @@
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "dev": true,
"funding": [
{
"type": "github",
@@ -11128,19 +10823,6 @@
}
]
},
- "node_modules/safe-stable-stringify": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
- "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/secure-json-parse": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",
- "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="
- },
"node_modules/semantic-release": {
"version": "21.1.1",
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-21.1.1.tgz",
@@ -11739,14 +11421,6 @@
"node": ">=8"
}
},
- "node_modules/sonic-boom": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.3.0.tgz",
- "integrity": "sha512-LYxp34KlZ1a2Jb8ZQgFCK3niIHzibdwtwNUWKg0qQRzsDoJ3Gfgkf8KdBTFU3SkejDEIlWwnSnpVdOZIhFMl/g==",
- "dependencies": {
- "atomic-sleep": "^1.0.0"
- }
- },
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -11820,6 +11494,7 @@
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
+ "dev": true,
"engines": {
"node": ">= 10.x"
}
@@ -11895,6 +11570,7 @@
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dev": true,
"dependencies": {
"safe-buffer": "~5.2.0"
}
@@ -11930,7 +11606,6 @@
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
@@ -11972,6 +11647,7 @@
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true,
"engines": {
"node": ">=8"
},
@@ -12096,14 +11772,6 @@
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true
},
- "node_modules/thread-stream": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.0.tgz",
- "integrity": "sha512-xZYtOtmnA63zj04Q+F9bdEay5r47bvpo1CaNqsKi7TpoJHcotUez8Fkfo2RJWpW91lnnaApdpRbVwCWsy+ifcw==",
- "dependencies": {
- "real-require": "^0.2.0"
- }
- },
"node_modules/through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@@ -12133,17 +11801,6 @@
"node": ">= 6"
}
},
- "node_modules/tmp": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
- "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==",
- "dependencies": {
- "rimraf": "^3.0.0"
- },
- "engines": {
- "node": ">=8.17.0"
- }
- },
"node_modules/tmpl": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
@@ -12387,15 +12044,8 @@
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
- },
- "node_modules/uuid": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
- "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
- "bin": {
- "uuid": "dist/bin/uuid"
- }
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true
},
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
@@ -12507,7 +12157,8 @@
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "dev": true
},
"node_modules/write-file-atomic": {
"version": "4.0.2",
@@ -12540,22 +12191,6 @@
"node": ">=10"
}
},
- "node_modules/ya-ts-client": {
- "version": "0.5.3",
- "resolved": "https://registry.npmjs.org/ya-ts-client/-/ya-ts-client-0.5.3.tgz",
- "integrity": "sha512-jwJmgmrb39NW/IKPjoH+ISKMCDna2Q9ylfmqQwVToKiOIrsnzt37ExxW6WxWrjJ5IZ8AkYfXQMOa2WRDvyZrJA==",
- "dependencies": {
- "axios": "^0.21.4"
- }
- },
- "node_modules/ya-ts-client/node_modules/axios": {
- "version": "0.21.4",
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
- "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
- "dependencies": {
- "follow-redirects": "^1.14.0"
- }
- },
"node_modules/yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
diff --git a/package.json b/package.json
index 20a3836..aca95b6 100644
--- a/package.json
+++ b/package.json
@@ -1,15 +1,17 @@
{
"name": "@golem-sdk/cli",
- "version": "0.1.0",
+ "version": "1.0.0",
"description": "CLI for Golem SDK",
- "main": "dist/main.js",
"repository": {
"type": "github",
"url": "github:GolemFactory/golem-sdk-cli"
},
+ "publishConfig": {
+ "access": "public"
+ },
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build": "tsc",
+ "build": "tsc --build",
"watch": "tsc --watch",
"lint": "npm run lint:ts && npm run lint:eslint",
"lint:ts": "tsc --project tsconfig.json --noEmit",
@@ -32,21 +34,19 @@
"marketplace",
"cli"
],
- "files": [
- "dist"
- ],
"author": "GolemFactory ",
- "license": "LGPL-3.0",
+ "license": "GPL-3.0",
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
- "@golem-sdk/golem-js": "^0.10.1",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"commander": "^11.0.0",
+ "enquirer": "^2.4.1",
"lodash": "^4.17.21",
"luxon": "^3.4.3",
+ "new-find-package-json": "^2.0.0",
"node-fetch": "^2.7.0",
"typescript": "^5.2.2"
},
diff --git a/src/lib/file.ts b/src/lib/file.ts
index c5d5f4f..5ecf3b7 100644
--- a/src/lib/file.ts
+++ b/src/lib/file.ts
@@ -21,3 +21,18 @@ export async function checkFileOverwrite(
// File does not exist, that's fine.
}
}
+
+export async function assertFileExists(name: string, path: string, extraHelp?: string): Promise {
+ extraHelp = extraHelp ? ` ${extraHelp}` : "";
+ try {
+ const stats = await stat(path);
+
+ if (!stats.isFile()) {
+ console.error(`Error: "${path}" is not a file.${extraHelp}`);
+ process.exit(1);
+ }
+ } catch (e) {
+ console.error(`Error: ${name} "${path}" not found.${extraHelp}`);
+ process.exit(1);
+ }
+}
diff --git a/src/lib/version.ts b/src/lib/version.ts
index 094c1c8..4108d63 100644
--- a/src/lib/version.ts
+++ b/src/lib/version.ts
@@ -1,3 +1,5 @@
-import * as json from "../../package.json";
+import * as fs from "fs";
+
+const json = JSON.parse(fs.readFileSync(__dirname + "/../../package.json").toString());
export const version = json.version;
diff --git a/src/main.ts b/src/main.ts
index 7a97af2..334d7b1 100755
--- a/src/main.ts
+++ b/src/main.ts
@@ -2,14 +2,15 @@
import { Command } from "commander";
import { version } from "./lib/version";
import { manifestCommand } from "./manifest/manifest.command";
+import { newCommand } from "./new/new.command";
-const program = new Command("golem-cli");
+const program = new Command("golem-sdk");
program.version(version);
// program.option('-n, --no-colors', 'Disable colors', (v) => {
// chalk.level = 0;
// });
-program.addCommand(manifestCommand);
+program.addCommand(manifestCommand).addCommand(newCommand);
program.parse();
diff --git a/src/manifest/manifest-create.action.ts b/src/manifest/manifest-create.action.ts
index fa9910d..93a84fd 100644
--- a/src/manifest/manifest-create.action.ts
+++ b/src/manifest/manifest-create.action.ts
@@ -1,9 +1,10 @@
import { ManifestCreateOptions } from "./manifest-create.options";
import { ManifestDto, ManifestVersions } from "./dto";
-import { writeFile } from "fs/promises";
+import { readFile, writeFile } from "fs/promises";
import { checkFileOverwrite } from "../lib/file";
import fetch from "node-fetch";
import { DateTime } from "luxon";
+import { findAsync } from "new-find-package-json";
const repoUrl = "https://registry.golem.network";
@@ -17,10 +18,11 @@ async function resolveTaskPackageUrl(tag: string): Promise {
const response = await fetch(url);
if (response.status === 404) {
- // TODO: Print url on debug and stop using exceptions.
- throw new Error(`Error: Image ${tag} not found.`);
+ console.error(`Error: Image ${tag} not found in image registry.`);
+ process.exit(1);
} else if (response.status != 200) {
- throw Error(`Failed to fetch image information: ${response.status} ${response.statusText}`);
+ console.error(`Error: Failed to fetch image information of ${tag} from image registry: ${response.statusText}`);
+ process.exit(1);
}
const data = (await response.json()) as { https: string; http: string; sha3: string };
@@ -86,9 +88,17 @@ function getImageUrlFromHash(hash: string): ImageInfo {
async function getImage(imageSpec: string, providedHash?: string): Promise {
const tagRegex = /^(.*?)\/(.*?):(.*)$/;
- const hashRegex = /^(\w+)$/;
+ const hashRegex = /^[a-z0-9]{56}$/;
+ const maybeHash = /^[a-z0-9]+$/;
+
+ if (maybeHash.test(imageSpec)) {
+ if (!hashRegex.test(imageSpec)) {
+ console.error(
+ `Error: Image name ${imageSpec} looks like a hash, but has invalid length. Please make sure it is a valid SHA3 hash.`,
+ );
+ process.exit(1);
+ }
- if (hashRegex.test(imageSpec)) {
return getImageUrlFromHash(imageSpec);
} else if (tagRegex.test(imageSpec)) {
return await getImageUrlFromTag(imageSpec, providedHash);
@@ -105,19 +115,96 @@ async function getImage(imageSpec: string, providedHash?: string): Promise {
+async function findPackageJson(possiblePath?: string): Promise {
+ if (possiblePath) {
+ return possiblePath;
+ }
+
+ // Find first package.json file.
+ for await (const path of findAsync(process.cwd(), "package.json")) {
+ return path;
+ }
+}
+
+async function fillOptionsWithPackageJson(options: ManifestCreateOptions): Promise {
+ if ("manifestVersion" in options && "name" in options && "description" in options) {
+ // All fields from package.json are provided.
+ return options;
+ }
+
+ const path = await findPackageJson(options.packageJson);
+ if (!path) {
+ console.error(
+ 'Error: Cannot find package.json. Use "--package-json" option to specify its path or make sure --name, --description and --manifest-version are set.',
+ );
+ process.exit(1);
+ }
+
+ // Read package.json.
+ let packageData: string;
+ try {
+ packageData = await readFile(path, "utf-8");
+ } catch (e) {
+ console.error(`Error: Cannot read ${path}: ${e}`);
+ process.exit(1);
+ }
+
+ // Parse package.json
+ let packageJson: { version: string; name: string; description?: string };
+ try {
+ packageJson = JSON.parse(packageData);
+ } catch (e) {
+ console.error(`Error: Cannot parse ${path}: ${e}`);
+ process.exit(1);
+ }
+
+ if (!("manifestVersion" in options)) {
+ options.manifestVersion = packageJson.version;
+ }
+
+ if (!("name" in options)) {
+ options.name = packageJson.name;
+ }
+
+ if (!("description" in options)) {
+ options.description = packageJson.description;
+ }
+
+ return options;
+}
+
+function validateImageInfo(imageInfo: ImageInfo) {
+ const hashWithFunctionRegEx = /^sha3:[a-z0-9]{56}$/;
+
+ try {
+ new URL(imageInfo.url);
+ } catch (e) {
+ console.error(`Error: Failed to parse image URL ${imageInfo.url}: ${e}`);
+ process.exit(1);
+ }
+
+ if (!hashWithFunctionRegEx.test(imageInfo.hash ?? "")) {
+ console.error(`Error: Invalid image hash ${imageInfo.hash}.`);
+ process.exit(1);
+ }
+}
+
+export async function manifestCreateAction(image: string, options: ManifestCreateOptions): Promise {
const imageData = await getImage(image, options.imageHash);
+ validateImageInfo(imageData);
const now = DateTime.now();
const expires = now.plus({ days: 90 }); // TODO: move that to options?
+ options = await fillOptionsWithPackageJson(options);
+
const manifest: ManifestDto = {
version: ManifestVersions.GAP_5,
createdAt: now.toISO() as string,
expiresAt: expires.toISO() as string,
metadata: {
- name,
+ name: options.name!,
description: options.description,
- version: options.version,
+ version: options.manifestVersion!,
},
payload: [
{
@@ -132,15 +219,12 @@ export async function manifestCreateAction(name: string, image: string, options:
};
// TODO: Add enquirer to ask for missing fields.
-
- manifest.metadata.name = name;
- manifest.metadata.description = options.description;
- manifest.metadata.version = options.version;
-
await checkFileOverwrite("Manifest", options.manifest, options.overwrite);
await writeFile(options.manifest, JSON.stringify(manifest, null, 2));
if (!imageData.hash) {
console.log("Warning: Image hash is not specified. You won't be able to start an activity before you fill it out.");
}
+
+ console.log("Created manifest in %s file", options.manifest);
}
diff --git a/src/manifest/manifest-create.command.ts b/src/manifest/manifest-create.command.ts
index 7b45654..8492942 100644
--- a/src/manifest/manifest-create.command.ts
+++ b/src/manifest/manifest-create.command.ts
@@ -7,12 +7,21 @@ manifestCreateCommand
.description("Create a new Golem manifest.")
.addOption(createManifestOption())
.option("-w, --overwrite", "Overwrite existing manifest (if present).")
+ .option("-n, --name ", "Name of the manifest/project.")
.option("-d, --description ", "Description of the manifest.")
- .option("-v, --version ", "Version of the manifest.", "1.0.0")
- .option("-i, --image-hash ", "Image hash to be used in the manifest (format 'hash-function:hash-base64'")
- .argument("", "Name of the manifest.")
- .argument("", "Image to be used in the manifest, identified by URL, image tag or image hash.")
- .action(async (name: string, image: string, options: ManifestCreateOptions) => {
+ .option("-v, --manifest-version ", "Version of the manifest.")
+ .option("-i, --image-hash ", "Image hash to be used in the manifest (format 'hash-function:hash-base64').")
+ .option("-p, --package-json ", "Package.json file to be used as information source.")
+ .argument(
+ "",
+ "Image to be used in the manifest, identified by URL, image tag or image hash. See README.md for details.",
+ )
+ .addHelpText(
+ "after",
+ "\npackage.json can be used to automatically fill manifest name, description and version." +
+ "\nIf package.json path is not provided, it will be looked for in current directory and all parent directories.",
+ )
+ .action(async (image: string, options: ManifestCreateOptions) => {
const action = await import("./manifest-create.action.js");
- await action.default.manifestCreateAction(name, image, options);
+ await action.default.manifestCreateAction(image, options);
});
diff --git a/src/manifest/manifest-create.options.ts b/src/manifest/manifest-create.options.ts
index c0245de..d96ef69 100644
--- a/src/manifest/manifest-create.options.ts
+++ b/src/manifest/manifest-create.options.ts
@@ -1,7 +1,9 @@
export interface ManifestCreateOptions {
- version: string;
+ manifestVersion?: string;
overwrite: boolean;
- description: string;
+ name?: string;
+ description?: string;
manifest: string;
- imageHash: string;
+ imageHash?: string;
+ packageJson?: string;
}
diff --git a/src/manifest/manifest-sign.action.ts b/src/manifest/manifest-sign.action.ts
index 2825551..84fe47f 100644
--- a/src/manifest/manifest-sign.action.ts
+++ b/src/manifest/manifest-sign.action.ts
@@ -2,9 +2,13 @@ import { ManifestSignOptions } from "./manifest-sign.options";
import { readManifest } from "./manifest-utils";
import { readFile, writeFile } from "fs/promises";
import { createSign } from "crypto";
+import { assertFileExists } from "../lib/file";
export async function manifestSignAction(options: ManifestSignOptions): Promise {
- // Read and validate the manifest.
+ await assertFileExists("Manifest file", options.manifest, "Check --manifest option.");
+ await assertFileExists("Private key file", options.keyFile, "Check --key-file option.");
+
+ // Validate the manifest. We don't need parsed data, so output is ignored.
await readManifest(options.manifest);
// Read manifest buffer.
@@ -12,16 +16,42 @@ export async function manifestSignAction(options: ManifestSignOptions): Promise<
const manifestBase64 = manifestBuffer.toString("base64");
const keyFile = await readFile(options.keyFile);
+ const passphraseRequired = keyFile.toString("ascii").includes("BEGIN ENCRYPTED PRIVATE KEY");
+
+ if (passphraseRequired && !options.passphrase) {
+ console.error("Error: Private key file is encrypted and no passphrase was provided. Use --passphrase option.");
+ process.exit(1);
+ } else if (!passphraseRequired && options.passphrase) {
+ console.error("Error: Private key file is not encrypted and passphrase was provided. Remove --passphrase option.");
+ process.exit(1);
+ }
- // Parse key file to KeyObject?
+ // Sign the manifest.
+ let signature: Buffer;
const sign = createSign("RSA-SHA256");
sign.update(manifestBase64);
- const signature = sign.sign({
- key: keyFile,
- // FIXME: Allow secure passphrase input and detect if a passphrase is needed.
- passphrase: options.passphrase,
- });
+
+ try {
+ signature = sign.sign({
+ key: keyFile,
+ passphrase: options.passphrase,
+ });
+ } catch (e) {
+ if (e instanceof Error && "code" in e) {
+ if (e.code === "ERR_OSSL_BAD_DECRYPT") {
+ console.error(`Error: Wrong passphrase provided for the private key ${options.keyFile}.`);
+ process.exit(1);
+ } else if (e.code === "ERR_OSSL_UNSUPPORTED") {
+ console.error(`Error: Private key file ${options.keyFile} is not supported.`);
+ process.exit(1);
+ }
+ }
+
+ throw e;
+ }
// write signature to options.signatureFile.
await writeFile(options.signatureFile, Buffer.from(signature).toString("base64"), "ascii");
+
+ console.log("Signed the manifest file and stored the signature in %s", options.signatureFile);
}
diff --git a/src/manifest/manifest-sign.command.ts b/src/manifest/manifest-sign.command.ts
index e310f2d..1b187e3 100644
--- a/src/manifest/manifest-sign.command.ts
+++ b/src/manifest/manifest-sign.command.ts
@@ -6,7 +6,7 @@ export const manifestSignCommand = new Command("sign");
manifestSignCommand
.description("Sign Golem manifest file.")
.addOption(createManifestOption())
- .option("-k, --key-file ", "Private key file.")
+ .requiredOption("-k, --key-file ", "Private key file.")
.option("-p, --passphrase ", "Passphrase for the private key.")
.option("-s, --signature-file ", "Signature file.", "manifest.sig")
.action(async (options: ManifestSignOptions) => {
diff --git a/src/manifest/manifest-utils.ts b/src/manifest/manifest-utils.ts
index 5b51813..d5a226d 100644
--- a/src/manifest/manifest-utils.ts
+++ b/src/manifest/manifest-utils.ts
@@ -1,23 +1,10 @@
import { ManifestDto } from "./dto";
-import { Stats } from "fs";
-import { readFile, stat } from "fs/promises";
+import { readFile } from "fs/promises";
import schema from "./computation-payload-manifest.schema.json";
import Ajv from "ajv";
import addFormats from "ajv-formats";
export async function readManifest(filename: string): Promise {
- let fileStats: Stats;
-
- try {
- fileStats = await stat(filename);
- } catch (e) {
- throw new Error(`Error: Manifest file ${filename} can't be read: ${e}`);
- }
-
- if (!fileStats.isFile()) {
- throw new Error(`Error: Manifest file ${filename} is not a file.`);
- }
-
let data: Buffer;
try {
data = await readFile(filename);
diff --git a/src/manifest/manifest-verify.action.ts b/src/manifest/manifest-verify.action.ts
index 68f2219..1d0df7b 100644
--- a/src/manifest/manifest-verify.action.ts
+++ b/src/manifest/manifest-verify.action.ts
@@ -4,41 +4,44 @@ import { ManifestVerifyOptions } from "./manifest-verify.options";
import { X509Certificate } from "node:crypto";
import { readFile } from "fs/promises";
import { createVerify } from "crypto";
+import { assertFileExists } from "../lib/file";
+
+function getLastCertificate(certificateChain: string, certFile: string): string {
+ const i = certificateChain.lastIndexOf("-----BEGIN CERTIFICATE-----");
+
+ if (i === -1) {
+ console.error(`Error: Could not locate the certificate to use for validation in ${certFile}.`);
+ process.exit(1);
+ }
+
+ return certificateChain.substring(i);
+}
export async function manifestVerifyAction(options: ManifestVerifyOptions) {
- // Read and validate the manifest.
+ await assertFileExists("Manifest file", options.manifest, "Check --manifest option.");
+ await assertFileExists("Certificate file", options.certificateFile, "Check --certificate-file option.");
+ await assertFileExists("Signature file", options.signatureFile, "Check --signature-file option.");
+
+ // Validate the manifest. We don't need parsed data, so output is ignored.
await readManifest(options.manifest);
// Read manifest buffer.
const manifestBuffer = await readFile(options.manifest);
const manifestBase64 = manifestBuffer.toString("base64");
- const certFile = Buffer.from(await readFile(options.certificateFile, "ascii"), "base64");
+ const certFile = await readFile(options.certificateFile, "ascii");
const signature = Buffer.from(await readFile(options.signatureFile, "ascii"), "base64");
- // const signature = await readFile(options.signature, 'ascii');
- // FIXME: Find better way to get the second (or last?) certificate.
- const certInput = certFile.toString();
- const i = certInput.indexOf("-----BEGIN CERTIFICATE-----", 2);
- const certSecond = certInput.substring(i);
-
- // const cert = new X509Certificate(certFile);
- const cert = new X509Certificate(Buffer.from(certSecond));
+ const certLast = getLastCertificate(certFile, options.certificateFile);
+ const cert = new X509Certificate(Buffer.from(certLast));
const verify = createVerify("RSA-SHA256");
verify.update(manifestBase64);
if (!verify.verify(cert.publicKey, signature)) {
- console.error("Manifest doesn't match signature.");
+ console.error("Error: Manifest doesn't match signature.");
process.exit(1);
}
- // TODO: Check if the certificate is not expired.
-
+ // TODO: Check if the certificate and manifest are not expired.
console.log("Manifest matches signature.");
- /*
- console.log('Certificate:', cert.publicKey.export({
- format: 'pem',
- type: 'pkcs1',
- }));
-*/
}
diff --git a/src/manifest/manifest-verify.command.ts b/src/manifest/manifest-verify.command.ts
index b8acd9b..28002cf 100644
--- a/src/manifest/manifest-verify.command.ts
+++ b/src/manifest/manifest-verify.command.ts
@@ -7,7 +7,7 @@ manifestVerifyCommand
.summary("Verify manifest file.")
.description("Verify manifest file for correctness and verify it's signature.")
.addOption(createManifestOption())
- .option("-c, --certificate-file ", "Certificate file.", "manifest.cert")
+ .option("-c, --certificate-file ", "Certificate file.", "manifest.pem")
.option("-s, --signature-file ", "Signature file (base64 encoded).", "manifest.sig")
.action(async (options: ManifestVerifyOptions) => {
const action = await import("./manifest-verify.action.js");
diff --git a/src/manifest/net/manifest-net-add-outbound.action.ts b/src/manifest/net/manifest-net-add-outbound.action.ts
index 89b8a98..26d75e6 100644
--- a/src/manifest/net/manifest-net-add-outbound.action.ts
+++ b/src/manifest/net/manifest-net-add-outbound.action.ts
@@ -4,6 +4,7 @@ import { ManifestCompManifestDto } from "../dto";
import { merge } from "lodash";
import { writeFile } from "fs/promises";
import { combineUniqueArrays } from "../../lib/data";
+import { assertFileExists } from "../../lib/file";
/**
* Parse provided urls and report error if any of them are invalid.
@@ -15,16 +16,18 @@ function parseUrls(urls: string[]): URL[] {
urls.forEach((url) => {
try {
- parsed.push(new URL(url));
+ const parsedUrl = new URL(url);
+ // TODO: Filter only supported protocols. Problem: we don't know yet what is supported.
+ parsed.push(parsedUrl);
} catch (e) {
errors.push(url);
}
});
if (errors.length) {
- console.error("Invalid URLs:");
+ console.error("Error: Invalid URLs provided:");
console.error(errors.map((url) => `- ${url}`).join("\n"));
- throw new Error("Invalid URL(s) provided.");
+ process.exit(1);
}
return parsed;
@@ -34,6 +37,8 @@ export async function manifestNetAddOutboundAction(
urls: string[],
options: ManifestNetAddOutboundOptions,
): Promise {
+ await assertFileExists("Manifest file", options.manifest, "Check --manifest option.");
+
const parsedUrls = parseUrls(urls);
const protocols = parsedUrls.map((url) => url.protocol.replace(/:$/, ""));
diff --git a/src/new/new.action.ts b/src/new/new.action.ts
new file mode 100644
index 0000000..c37d3c0
--- /dev/null
+++ b/src/new/new.action.ts
@@ -0,0 +1,171 @@
+import { NewOptions, newProjectNameError, newProjectNameRegEx } from "./new.options";
+
+import { prompt } from "enquirer";
+import { join } from "path";
+import { existsSync } from "fs";
+import { cp, readFile, writeFile } from "fs/promises";
+
+async function getName(providedName: string): Promise {
+ if (!providedName) {
+ const result = (await prompt({
+ type: "input",
+ name: "name",
+ message: "Project name",
+ validate(value: string) {
+ return !newProjectNameRegEx.test(value) ? newProjectNameError : true;
+ },
+ })) as { name: string };
+
+ providedName = result.name;
+ } else {
+ if (!newProjectNameRegEx.test(providedName)) {
+ console.error(`Error: Project name ${providedName} is invalid: ${newProjectNameError}`);
+ process.exit(1);
+ }
+ }
+
+ return providedName;
+}
+
+async function getVersion(providedVersion?: string): Promise {
+ if (typeof providedVersion === "string") {
+ return providedVersion;
+ }
+
+ const result = (await prompt({
+ type: "input",
+ name: "version",
+ message: "Project version",
+ initial: "1.0.0",
+ })) as { version: string };
+
+ return result.version;
+}
+
+async function getTemplate(providedTemplate?: string): Promise {
+ if (typeof providedTemplate !== "string") {
+ const result = (await prompt({
+ type: "select",
+ name: "template",
+ message: "Select a project template",
+ choices: [
+ { name: "js-node", hint: "Plain Javascript CLI application" },
+ // { name: "js-webapp", hint: "Plain Javascript Express based web application" },
+ ],
+ })) as { template: string };
+
+ providedTemplate = result.template;
+ }
+
+ if (!newProjectNameRegEx.test(providedTemplate)) {
+ console.error(`Error: Template name ${providedTemplate} is invalid.`);
+ process.exit(1);
+ }
+
+ return providedTemplate;
+}
+
+async function getDescription(providedDescription?: string): Promise {
+ if (typeof providedDescription === "string") {
+ return providedDescription;
+ }
+
+ const result = (await prompt({
+ type: "input",
+ name: "description",
+ message: "Project description",
+ initial: "An unique and awesome application that runs on Golem Network",
+ })) as { description: string };
+
+ return result.description;
+}
+
+type PackageJsonBasic = {
+ name: string;
+ description: string;
+ version: string;
+ author?: string;
+};
+
+async function updatePackageJson(projectPath: string, data: PackageJsonBasic): Promise {
+ const packageJson = join(projectPath, "package.json");
+ let input: string;
+ let json: PackageJsonBasic;
+
+ try {
+ input = await readFile(packageJson, "utf8");
+ } catch (e) {
+ console.error(`Error: Failed to read ${packageJson}: ${e}`);
+ process.exit(1);
+ }
+
+ try {
+ json = JSON.parse(input);
+ } catch (e) {
+ console.error(`Error: Failed to parse ${packageJson}: ${e}`);
+ process.exit(1);
+ }
+
+ json.name = data.name;
+ json.description = data.description;
+ json.version = data.version;
+ if (data.author) {
+ json.author = data.author;
+ }
+
+ try {
+ await writeFile(packageJson, JSON.stringify(json, null, 2));
+ } catch (e) {
+ console.error(`Error: Failed to write ${packageJson}: ${e}`);
+ process.exit(1);
+ }
+}
+
+export async function newAction(providedName: string, options: NewOptions) {
+ const name = await getName(providedName);
+ const projectPath = options.path ?? join(process.cwd(), name);
+ if (existsSync(projectPath)) {
+ console.error(`Error: ${projectPath} already exists.`);
+ process.exit(1);
+ }
+
+ const template = await getTemplate(options.template);
+ const templatePath = join(__dirname, "../../data/project-templates", template);
+ if (!existsSync(templatePath)) {
+ console.error(`Error: Template ${template} not found.`);
+ process.exit(1);
+ }
+
+ const description = await getDescription(options.description);
+ const version = await getVersion(options.version);
+ const author = options.author;
+
+ console.log(`Creating a new Golem app in ${projectPath}.`);
+
+ try {
+ await cp(templatePath, projectPath, { recursive: true });
+ } catch (e) {
+ console.error(`Error: Failed to copy template files: ${e}`);
+ process.exit(1);
+ }
+
+ // Update package.json
+ await updatePackageJson(projectPath, {
+ name,
+ description,
+ version,
+ author,
+ });
+
+ // TODO: Consider running npm install (or yarn, or whatever).
+
+ console.log(`Project created successfully in ${projectPath}.`);
+
+ if (!process.env.YAGNA_APPKEY) {
+ console.log(
+ "NOTE: You do not seem to have YAGNA_APPKEY environment variable defined. You will need to define it or provide a .env file with it to run your new appplication.",
+ );
+ }
+
+ // TODO: Show some next steps, or pull it from template directory.
+}
diff --git a/src/new/new.command.ts b/src/new/new.command.ts
new file mode 100644
index 0000000..f00e69a
--- /dev/null
+++ b/src/new/new.command.ts
@@ -0,0 +1,20 @@
+import { Command } from "commander";
+import { NewOptions } from "./new.options";
+
+export const newCommand = new Command("new");
+
+newCommand
+ .summary("Create new Golem project.")
+ .description("Create a new Golem project from template.")
+ .option("-p, --path ", "Path of the new project.")
+ .option("-t, --template ", "Template to be used for the project.")
+ .option("-d, --description ", "Description of the project.")
+ .option("-a, --author ", "Author of the project.") // TODO: try to read it from git config?
+ .option("-v, --version ", "Version of the project.")
+ // TODO: implement list-templates?
+ // .option("-l, --list-templates", "List available projecttemplates.")
+ .argument("[name]", "Name of the project.")
+ .action(async (name: string, options: NewOptions) => {
+ const action = await import("./new.action.js");
+ await action.default.newAction(name, options);
+ });
diff --git a/src/new/new.options.ts b/src/new/new.options.ts
new file mode 100644
index 0000000..cb36ed5
--- /dev/null
+++ b/src/new/new.options.ts
@@ -0,0 +1,11 @@
+export interface NewOptions {
+ author?: string;
+ description?: string;
+ path?: string;
+ template?: string;
+ version?: string;
+}
+
+export const newProjectNameRegEx = /^[a-z0-9-_]+$/;
+export const newProjectNameError =
+ "Project name may only contain lower case letters, numbers, hyphens and underscores.";
diff --git a/tsconfig.json b/tsconfig.json
index 4076629..31c13dc 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -16,7 +16,8 @@
}
},
"compilerOptions": {
- "outDir": "dist",
+ "outDir": "dist/",
+ "rootDir": "src/",
"experimentalDecorators": true,
"resolveJsonModule": true,
"moduleResolution": "node16"