diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 70b5e181..00000000 --- a/.babelrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugins": [ - "transform-class-properties", - "transform-decorators-legacy", - "transform-es2015-destructuring", - "transform-es2015-spread", - "transform-flow-strip-types", - "transform-runtime" - ], - "presets": ["es2015", "latest", "stage-0", "stage-1"] -} diff --git a/.editorconfig b/.editorconfig index d4eed840..e24e92fd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,7 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = false -indent_style = space -indent_size = 2 +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 2 diff --git a/.eslintignore b/.eslintignore index 07d7cfc2..5c7f5de5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,13 +1,13 @@ -flow-typed - -# Don't check auto-generated stuff -coverage -build -dist -binaries -node_modules - -# Cruft -.DS_Store -npm-debug.log -.idea +packages + +# Don't check auto-generated stuff +coverage +build +dist +binaries +node_modules + +# Cruft +.DS_Store +npm-debug.log +.idea diff --git a/.eslintrc b/.eslintrc index 431dd96c..2b3a919a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,34 +1,18 @@ { - "extends": "airbnb-base", - "parser": "babel-eslint", - "plugins": [ - "flowtype", - "sorting" + "root": true, + "parserOptions": { + "project": "./tsconfig.json", + }, + "plugins": ["@typescript-eslint", "import", "prettier"], + "extends": [ + "airbnb-typescript/base", + "prettier", + "plugin:@typescript-eslint/recommended", + "plugin:import/typescript", ], + "parser": "@typescript-eslint/parser", "rules": { "eol-last": 2, - "flowtype/define-flow-type": 1, - "flowtype/require-parameter-type": 1, - "flowtype/require-valid-file-annotation": [ - 2, - "always" - ], - "flowtype/require-return-type": [ - 1, - "always", - { - "annotateUndefined": "never" - } - ], - "flowtype/space-after-type-colon": [ - 1, - "always" - ], - "flowtype/space-before-type-colon": [ - 1, - "never" - ], - "flowtype/use-flow-type": 1, "import/first": 0, "import/newline-after-import": 0, "import/no-duplicates": 0, @@ -43,14 +27,43 @@ "no-mixed-operators": 0, "no-underscore-dangle": 0, "no-use-before-define": 0, - "object-curly-spacing": 2, - "semi": 2, - "sorting/sort-object-props": [ + "class-methods-use-this": "off", + "no-promise-executor-return": "off", + "quotes": [ 2, + "single", { - "ignoreCase": true, - "ignoreMethods": false - } - ] - } + "avoidEscape": true, + }, + ], + "semi": 2, + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", // or "error" + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + }, + ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": ["parameter", "variable"], + "leadingUnderscore": "forbid", + "filter": { + // keep this one open for destructuring + "regex": "_*", + "match": false, + }, + "format": null, + }, + { + "selector": "parameter", + "leadingUnderscore": "require", + "format": null, + "modifiers": ["unused"], + }, + ], + }, } diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index 46902fec..00000000 --- a/.flowconfig +++ /dev/null @@ -1,9 +0,0 @@ -[ignore] - -[include] - -[libs] - -[options] -esproposal.decorators=ignore -esproposal.class_instance_fields=enable \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..178a3fb8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# hide dist files in commit diffs. +dist/* linguist-generated diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..fbab8837 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +on: + push: + branches: dev + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + - run: npm ci --include=optional + - run: npm run build:all + # - run: npm run test:all + - name: Publish @brewskey/spark-protocol + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_PUBLISH }} + access: public + package: ./packages/spark-protocol + - name: Publish @brewskey/spark-server + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_PUBLISH }} + access: public diff --git a/.gitignore b/.gitignore index 99bbbcf4..a28b1175 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,10 @@ __test_data__ *.der *.pem *.pub.pem - -# build folder build +.env + +settings.json +temp +path +dist \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..bbee69b7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "trailingComma": "all" +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..73a5fdbb --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Node.js-Debugattribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Programm starten", + "program": "${workspaceRoot}\\dist\\scripts\\update-firmware-binaries.js" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..2ff890aa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "javascript.validate.enable": false, + "flow.useNPMPackagedFlow": true, + "eslint.format.enable": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "jest.runMode": "on-demand", + "typescript.tsdk": "node_modules\\typescript\\lib", + "cSpell.words": ["nullthrows"] +} diff --git a/INSTALL.md b/INSTALL.md index 7d9999c1..4641685b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,9 +1,9 @@ - - -Installing Spark-Server -======================== - - -Server Keys -Core Keys + + +Installing Spark-Server +======================== + + +Server Keys +Core Keys User Accounts \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 2def0e88..9a5e16f7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,661 +1,661 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 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 Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are 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. - - 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. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - 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 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 work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - 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 AGPL, see + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 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 Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are 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. + + 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. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + 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 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 work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + 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 AGPL, see . \ No newline at end of file diff --git a/README.md b/README.md index 4679ee79..57b1e46b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ -spark-server -============ +# spark-server These instructions have been modified for the Brewskey clone of the local cloud :) An API compatible open source server for interacting with devices speaking the [spark-protocol](https://github.com/Brewskey/spark-protocol) +We support + +- OTA Updates - user application as well as system updates +- Product API - fleet management by grouping devices. +- Firmware compilation +
    __  __            __                 __        __                ____
   / /_/ /_  ___     / /___  _________ _/ /  _____/ /___  __  ______/ / /
@@ -13,142 +18,198 @@ An API compatible open source server for interacting with devices speaking the [
 \__/_/ /_/\___/  /_/\____/\___/\__,_/_/   \___/_/\____/\__,_/\__,_(_)   
 
+# Quick Install + +``` +git clone https://github.com/Brewskey/spark-server.git +cd spark-server/ +``` -Quick Install -============== +In order to download the firmware files for OTA updates, you'll need to create +a `.env` file in the server root. -### You'll need to prepare your system for node-gyp. This is used in the URSA package. -**https://github.com/nodejs/node-gyp** +You'll need to create an OAuth token under your github settings with the `public_repo` permission + +The .env file needs the following: + +``` +GITHUB_AUTH_TOKEN= +``` + +Then run from the CLI: ``` -git clone https://github.com/Brewsky/spark-server.git -cd spark-server/ npm install -./node_modules/.bin/babel src/ -d lib -node lib/main.js ``` +**You may need to run npx `update-firmware` a few times in order to fetch all the binaries if your install didn't succeed.** +Github limits you to 5000 requests per hour so you'd need to run it again after an hour. + +_At this point we will be setting up the server. You should change the default username + password in ./dist/settings.js_ + The babel command pre-processes all the src/ to allow modern node syntax to be used in older versions of node. The modified code that is -actually running lives in lib/ -If you change anything in src/ you'll need to rerun babel for changes +actually running lives in dist/ +If you change anything in src/ you'll need to rerun `npm run build` for changes to take effect. - -> **Windows Setup** -> You'll need to install Python 2.7 and OpenSSL 1.0.2 or older. -> *The newer version doesn't have the lib files needed to build the project*. -> [Python Download](https://www.python.org/downloads/) -> [OpenSSL Download](http://slproweb.com/products/Win32OpenSSL.html) - + [Raspberry pi Quick Install](raspberryPi.md) +# How do I get started? -How do I get started? -===================== +1. Run the server with: + Run with babel (useful for local development) -1) Run the server with: +``` +npm start +``` + +For production - uses transpiled files from babel. ``` -node lib/main.js +npm run start:prod ``` -2) Watch for your IP address, you'll see something like: +2. Watch for your IP address, you'll see something like: ``` Your server IP address is: 192.168.1.10 ``` -3) We will now create a new server profile on Particle-CLI using the command: +3. We will now create a new server profile on Particle-CLI using the command: ``` -particle config profile_name apiUrl "http://DOMAIN_OR_IP" +particle config profile_name apiUrl "http://DOMAIN_OR_IP" ``` -For the local cloud, the port number 8080 needs to be added behind: `http://domain_or_ip:8080`. It is important to also have the `http://` otherwise it won't work. +For the local cloud, the port number 8080 needs to be added behind: `http://domain_or_ip:8080`. It is important to also have the `http://` otherwise it won't work. This will create a new profile to point to your server and switching back to the spark cloud is simply `particle config particle` and other profiles would be `particle config profile_name` -4) We will now point over to the local cloud using +4. We will now point over to the local cloud using + ``` particle config profile_name ``` -5) On a separate CMD from the one running the server, type +5. On a separate CMD from the one running the server, type ``` -particle setup +particle login --username __admin__ --password adminPassword ``` +The default username is `__admin__` and password is `adminPassword`. + This will create an account on the local cloud +_This creates a config file located in the `%userprofile%/.particle%` folder_ Perform CTRL + C once you logon with Particle-CLI asking you to send Wifi-credentials etc... -6) Put your core into listening mode, and run +6. Put your core into listening mode, and run + ``` particle identify ``` + to get your core id. You'll need this id later -7) The next steps will generate a bunch of keys for your device. I recommend `mkdir ..\temp` and `cd ..\temp` +7. The next steps will generate a bunch of keys for your device. I recommend `mkdir ..\temp` and `cd ..\temp` -8) Change server keys to local cloud key + IP Address +8. Put your device in DFU mode. + +9. Change server keys to local cloud key + IP Address ``` -particle keys server ..\spark-server\data\default_key.pub.pem IP_ADDRESS +particle keys server ..\spark-server\data\default_key.pub.pem --host IP_ADDRESS --protocol tcp ``` -**Note You can go back to using the particle cloud by [downlading the public key here](https://s3.amazonaws.com/spark-website/cloud_public.der).** + +**Note You can go back to using the particle cloud by [downloading the public key here](https://s3.amazonaws.com/spark-website/cloud_public.der).** You'll need to run `particle config particle`, `particle keys server cloud_public.der`, and `particle keys doctor your_core_id` while your device is in DFU mode. -9) Create and provision access on your local cloud with the keys doctor: +10. Create and provision access on your local cloud with the keys doctor: ``` particle keys doctor your_core_id ``` -*** +**Note For Electrons and probably all newer hardware you need to run these commands** +There is either a bug in the CLI or Particle always expects these newer devices to use UDP. + +Put your device in DFU mode and then: + +``` +particle keys new test_key --protocol tcp +particle keys load test_key.der +particle keys send XXXXXXXXXXXXXXXXXXXXXXXX test_key.pub.pem +``` + +--- + +At this point you should be able to run normal cloud commands and flash binaries. You can add any webhooks you need, call functions, or get variable values. + +# Configuring Spark Server + +In most cases you'll want to connect to a MongoDB instance as it's going to be a lot more performant than using the built-in NeDB implementation. +You may also want to change the default admin password or have your server use SSL certificates. + +**This can all be accomplished by creating a `settings.json` file in the root of the project.** -At this point you should be able to run normal cloud commands and flash binaries. You can add any webhooks you need, call functions, or get variable values. +1. `cd /my-root-where-i-have-the-repo` +2. `cp settings.example.json settings.json` +3. [Edit the json with any of the keys that are set in settings.js](https://github.com/Brewskey/spark-server/blob/dev/src/settings.js#L33-L71) +4. Run `npm install` if you changed some directories of the binaries (I'd do it just to be safe anyways) +5. `npm run start:prod` +6. You should see the JSON changes you made log in the console and the server should run with your changes. +# Electron Support -What's different to the original spark-server? -============================================== +Yes, this supports Electron but only over TCP. TCP will drastically increase +the amount of data used so watch out. + +In order to set up your Electron to work on the server you need to run the +following while the device is in DFU-mode: + +``` +particle keys server default_key.pub.pem IP_ADDRESS 5683 --protocol tcp +// Sometimes you need to run the next line as well +particle keys protocol tcp +``` + +# What's different to the original spark-server? The way the system stores data has changed. On first run the server creates the following directories for storing data about your local cloud: - - `data/` - - The cloud keys `default_key.pem` and `default_key.pub.pem` go directly in here. Previously these keys lived in the main directory. - - `data/deviceKeys/` - - Device keys (.pub.pem) and information (.json) for each device live in here. Previously these were found in `core_keys/` - - `data/users/` - - User account data (.json) for each user live in here. Previously stored in `users/` - - `data/knownApps/` - - ??? - - `data/webhooks/` - - ??? +- `data/` +- The cloud keys `default_key.pem` and `default_key.pub.pem` go directly in here. Previously these keys lived in the main directory. +- `data/deviceKeys/` +- Device keys (.pub.pem) and information (.json) for each device live in here. Previously these were found in `core_keys/` +- `data/users/` +- User account data (.json) for each user live in here. Previously stored in `users/` +- `data/knownApps/` +- ??? +- `data/webhooks/` +- ??? -What kind of project is this? -====================================== +# What kind of project is this? This is a refactored clone of the original spark-server because this is what the awesome guys at Particle.io said: We're open sourcing our core Spark-protocol code to help you build awesome stuff with your Spark Core, and with your -other projects. We're also open sourcing an example server with the same easy to use Rest API as the Spark Cloud, so -your local apps can easily run against both the Spark Cloud, and your local cloud. We're really excited about this, +other projects. We're also open sourcing an example server with the same easy to use Rest API as the Spark Cloud, so +your local apps can easily run against both the Spark Cloud, and your local cloud. We're really excited about this, and we have tried to build an open, stable, and powerful platform, and hand it over to you, the community. This project is our way of making sure you can change and see into every aspect of your Spark Core, yay! We'll keep improving and adding features, and we hope you'll want to join in too! - -What features are currently present -==================================== +# What features are currently present This feature list is not correct wrt the Brewskey clone - there's much more! -The spark-server module aims to provide a HTTP rest interface that is API compatible with the main Spark Cloud. Ideally any -programs you write to run against the Spark Cloud should also work on the Local Cloud. Some features aren't here yet, but may be +The spark-server module aims to provide a HTTP rest interface that is API compatible with the main Spark Cloud. Ideally any +programs you write to run against the Spark Cloud should also work on the Local Cloud. Some features aren't here yet, but may be coming down the road, right now the endpoints exposed are: Claim Core @@ -208,22 +269,11 @@ Publish an event `POST /v1/devices/events` -What features will be added soon? -==================================== - -- per-user / per-core ownership and access restrictions. Right now ANY user on your local cloud can access ANY device. - -- remote compiling, however flashing a binary will still work - - -What API features are missing -================================ - - - the build IDE is not part of this release, but may be released separately later - - massive enterprise magic super horizontal scaling powers +# What API features are missing +- the build IDE is not part of this release, but may be released separately later +- massive enterprise magic super horizontal scaling powers -Known Limitations -================== +# Known Limitations -We worked hard to make our cloud services scalable and awesome, but that also presents a burden for new users. This release was designed to be easy to use, to understand, and to maintain, and not to discourage anyone who is new to running a server. This means some of the fancy stuff isn't here yet, but don't despair, we'll keep improving this project, and we hope you'll use it to build awesome things. +We worked hard to make our cloud services scalable and awesome, but that also presents a burden for new users. This release was designed to be easy to use, to understand, and to maintain, and not to discourage anyone who is new to running a server. This means some of the fancy stuff isn't here yet, but don't despair, we'll keep improving this project, and we hope you'll use it to build awesome things. diff --git a/dist/OAuthModel.js b/dist/OAuthModel.js deleted file mode 100644 index 6c7ca2dd..00000000 --- a/dist/OAuthModel.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var OAUTH_CLIENTS = [{ - clientId: 'CLI2', - clientSecret: 'client_secret_here', - grants: ['password'] -}]; - -var OauthModel = function OauthModel(userRepository) { - var _this = this; - - (0, _classCallCheck3.default)(this, OauthModel); - - this.getAccessToken = function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(bearerToken) { - var user, userTokenObject; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return _this._userRepository.getByAccessToken(bearerToken); - - case 2: - user = _context.sent; - - if (user) { - _context.next = 5; - break; - } - - return _context.abrupt('return', null); - - case 5: - userTokenObject = user.accessTokens.find(function (tokenObject) { - return tokenObject.accessToken === bearerToken; - }); - - if (userTokenObject) { - _context.next = 8; - break; - } - - return _context.abrupt('return', null); - - case 8: - return _context.abrupt('return', { - accessToken: userTokenObject.accessToken, - user: user - }); - - case 9: - case 'end': - return _context.stop(); - } - } - }, _callee, _this); - })); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }(); - - this.getClient = function (clientId, clientSecret) { - return OAUTH_CLIENTS.find(function (client) { - return client.clientId === clientId && client.clientSecret === clientSecret; - }); - }; - - this.getUser = function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(username, password) { - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return _this._userRepository.validateLogin(username, password); - - case 2: - return _context2.abrupt('return', _context2.sent); - - case 3: - case 'end': - return _context2.stop(); - } - } - }, _callee2, _this); - })); - - return function (_x2, _x3) { - return _ref2.apply(this, arguments); - }; - }(); - - this.saveToken = function (tokenObject, client, user) { - _this._userRepository.saveAccessToken(user.id, tokenObject); - return { - accessToken: tokenObject.accessToken, - client: client, - user: user - }; - }; - - this.validateScope = function (user, client, scope) { - return 'true'; - }; - - this._userRepository = userRepository; -} - -// eslint-disable-next-line no-unused-vars -; - -exports.default = OauthModel; \ No newline at end of file diff --git a/dist/RouteConfig.js b/dist/RouteConfig.js deleted file mode 100644 index 166e71eb..00000000 --- a/dist/RouteConfig.js +++ /dev/null @@ -1,224 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _promise = require('babel-runtime/core-js/promise'); - -var _promise2 = _interopRequireDefault(_promise); - -var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray'); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _create = require('babel-runtime/core-js/object/create'); - -var _create2 = _interopRequireDefault(_create); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _getOwnPropertyNames = require('babel-runtime/core-js/object/get-own-property-names'); - -var _getOwnPropertyNames2 = _interopRequireDefault(_getOwnPropertyNames); - -var _expressOauthServer = require('express-oauth-server'); - -var _expressOauthServer2 = _interopRequireDefault(_expressOauthServer); - -var _nullthrows = require('nullthrows'); - -var _nullthrows2 = _interopRequireDefault(_nullthrows); - -var _multer = require('multer'); - -var _multer2 = _interopRequireDefault(_multer); - -var _OAuthModel = require('./OAuthModel'); - -var _OAuthModel2 = _interopRequireDefault(_OAuthModel); - -var _HttpError = require('./lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var maybe = function maybe(middleware, condition) { - return function (request, response, next) { - if (condition) { - middleware(request, response, next); - } else { - next(); - } - }; -}; - -var injectUserMiddleware = function injectUserMiddleware() { - return function (request, response, next) { - var oauthInfo = response.locals.oauth; - if (oauthInfo) { - var token = oauthInfo.token; - // eslint-disable-next-line no-param-reassign - request.user = token && token.user; - } - next(); - }; -}; - -// in old codebase there was _keepAlive() function in controllers , which -// prevents of closing server-sent-events stream if there aren't events for -// a long time, but according to the docs sse keep connection alive automatically. -// if there will be related issues in the future, we can return _keepAlive() back. -var serverSentEventsMiddleware = function serverSentEventsMiddleware() { - return function (request, response, next) { - request.socket.setNoDelay(); - response.writeHead(200, { - 'Cache-Control': 'no-cache', - Connection: 'keep-alive', - 'Content-Type': 'text/event-stream' - }); - - next(); - }; -}; - -exports.default = function (app, container, controllers, settings) { - var oauth = new _expressOauthServer2.default({ - ACCESS_TOKEN_LIFETIME: settings.ACCESS_TOKEN_LIFETIME, - allowBearerTokensInQueryString: true, - model: new _OAuthModel2.default(container.constitute('UserRepository')) - }); - - var filesMiddleware = function filesMiddleware() { - var allowedUploads = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - return (0, _nullthrows2.default)(allowedUploads).length ? (0, _multer2.default)().fields(allowedUploads) : (0, _multer2.default)().any(); - }; - - app.post(settings.LOGIN_ROUTE, oauth.token()); - - controllers.forEach(function (controllerName) { - var controller = container.constitute(controllerName); - (0, _getOwnPropertyNames2.default)((0, _getPrototypeOf2.default)(controller)).forEach(function (functionName) { - var mappedFunction = controller[functionName]; - var allowedUploads = mappedFunction.allowedUploads, - anonymous = mappedFunction.anonymous, - httpVerb = mappedFunction.httpVerb, - route = mappedFunction.route, - serverSentEvents = mappedFunction.serverSentEvents; - - - if (!httpVerb) { - return; - } - app[httpVerb](route, maybe(oauth.authenticate(), !anonymous), maybe(serverSentEventsMiddleware(), serverSentEvents), injectUserMiddleware(), maybe(filesMiddleware(allowedUploads), allowedUploads), function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(request, response) { - var argumentNames, values, controllerInstance, _request$body, access_token, body, functionResult, result, httpError; - - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - argumentNames = (route.match(/:[\w]*/g) || []).map(function (argumentName) { - return argumentName.replace(':', ''); - }); - values = argumentNames.map(function (argument) { - return request.params[argument]; - }); - controllerInstance = container.constitute(controllerName); - - // In order parallel requests on the controller, the state - // (request/response/user) must be added to the controller. - - if (controllerInstance === controller) { - // throw new Error( - // '`Transient.with` must be used when binding controllers', - // ); - controllerInstance = (0, _create2.default)(controllerInstance); - } - - controllerInstance.request = request; - controllerInstance.response = response; - controllerInstance.user = request.user; - - // Take access token out if it's posted. - _request$body = request.body, access_token = _request$body.access_token, body = (0, _objectWithoutProperties3.default)(_request$body, ['access_token']); - _context.prev = 8; - functionResult = mappedFunction.call.apply(mappedFunction, [controllerInstance].concat((0, _toConsumableArray3.default)(values), [body])); - - if (!functionResult.then) { - _context.next = 17; - break; - } - - _context.next = 13; - return _promise2.default.race([functionResult, !serverSentEvents ? new _promise2.default(function (resolve, reject) { - return setTimeout(function () { - return reject(new Error('timeout')); - }, settings.API_TIMEOUT); - }) : null]); - - case 13: - result = _context.sent; - - response.status((0, _nullthrows2.default)(result).status).json((0, _nullthrows2.default)(result).data); - _context.next = 18; - break; - - case 17: - response.status(functionResult.status).json(functionResult.data); - - case 18: - _context.next = 24; - break; - - case 20: - _context.prev = 20; - _context.t0 = _context['catch'](8); - httpError = new _HttpError2.default(_context.t0); - - response.status(httpError.status).json({ - error: httpError.message, - ok: false - }); - - case 24: - case 'end': - return _context.stop(); - } - } - }, _callee, undefined, [[8, 20]]); - })); - - return function (_x2, _x3) { - return _ref.apply(this, arguments); - }; - }()); - }); - }); - - app.all('*', function (request, response) { - response.sendStatus(404); - }); - - app.use(function (error, request, response, next) { - response.status(400).json({ - error: error.code ? error.code : error, - ok: false - }); - }); -}; \ No newline at end of file diff --git a/dist/app.js b/dist/app.js deleted file mode 100644 index 3364ac19..00000000 --- a/dist/app.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _bodyParser = require('body-parser'); - -var _bodyParser2 = _interopRequireDefault(_bodyParser); - -var _express = require('express'); - -var _express2 = _interopRequireDefault(_express); - -var _morgan = require('morgan'); - -var _morgan2 = _interopRequireDefault(_morgan); - -var _RouteConfig = require('./RouteConfig'); - -var _RouteConfig2 = _interopRequireDefault(_RouteConfig); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (container, settings) { - var app = (0, _express2.default)(); - - var setCORSHeaders = function setCORSHeaders(request, response, next) { - if (request.method === 'OPTIONS') { - response.set({ - 'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type, Accept, Authorization', - 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Max-Age': '300' - }); - return response.sendStatus(204); - } - response.set({ 'Access-Control-Allow-Origin': '*' }); - return next(); - }; - - if (settings.LOG_REQUESTS) { - app.use((0, _morgan2.default)('combined')); - } - - app.use(_bodyParser2.default.json()); - app.use(_bodyParser2.default.urlencoded({ extended: true })); - app.use(setCORSHeaders); - - (0, _RouteConfig2.default)(app, container, ['DeviceClaimsController', - // to avoid routes collisions EventsController should be placed - // before DevicesController - 'EventsController', 'DevicesController', 'OauthClientsController', 'ProductsController', 'ProvisioningController', 'UsersController', 'WebhooksController'], settings); - - return app; -}; \ No newline at end of file diff --git a/dist/controllers/Controller.js b/dist/controllers/Controller.js deleted file mode 100644 index b11205a2..00000000 --- a/dist/controllers/Controller.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = undefined; - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Controller = function Controller() { - (0, _classCallCheck3.default)(this, Controller); - - this.bad = function (message) { - var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400; - return { - data: { - error: message, - ok: false - }, - status: status - }; - }; - - this.ok = function (output) { - return { - data: output, - status: 200 - }; - }; -}; - -exports.default = Controller; \ No newline at end of file diff --git a/dist/controllers/DeviceClaimsController.js b/dist/controllers/DeviceClaimsController.js deleted file mode 100644 index 1789c62b..00000000 --- a/dist/controllers/DeviceClaimsController.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _desc, _value, _class; - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var DeviceClaimsController = (_dec = (0, _httpVerb2.default)('post'), _dec2 = (0, _route2.default)('/v1/device_claims'), (_class = function (_Controller) { - (0, _inherits3.default)(DeviceClaimsController, _Controller); - - function DeviceClaimsController(deviceManager, claimCodeManager) { - (0, _classCallCheck3.default)(this, DeviceClaimsController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (DeviceClaimsController.__proto__ || (0, _getPrototypeOf2.default)(DeviceClaimsController)).call(this)); - - _this._deviceManager = deviceManager; - _this._claimCodeManager = claimCodeManager; - return _this; - } - - (0, _createClass3.default)(DeviceClaimsController, [{ - key: 'createClaimCode', - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { - var claimCode, devices, deviceIDs; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - claimCode = this._claimCodeManager.createClaimCode(this.user.id); - _context.next = 3; - return this._deviceManager.getAll(this.user.id); - - case 3: - devices = _context.sent; - deviceIDs = devices.map(function (device) { - return device.deviceID; - }); - return _context.abrupt('return', this.ok({ claim_code: claimCode, device_ids: deviceIDs })); - - case 6: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function createClaimCode() { - return _ref.apply(this, arguments); - } - - return createClaimCode; - }() - }]); - return DeviceClaimsController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'createClaimCode', [_dec, _dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'createClaimCode'), _class.prototype)), _class)); -exports.default = DeviceClaimsController; \ No newline at end of file diff --git a/dist/controllers/DevicesController.js b/dist/controllers/DevicesController.js deleted file mode 100644 index 43223ede..00000000 --- a/dist/controllers/DevicesController.js +++ /dev/null @@ -1,507 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _extends2 = require('babel-runtime/helpers/extends'); - -var _extends3 = _interopRequireDefault(_extends2); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _desc, _value, _class; - -var _nullthrows = require('nullthrows'); - -var _nullthrows2 = _interopRequireDefault(_nullthrows); - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -var _FirmwareCompilationManager = require('../managers/FirmwareCompilationManager'); - -var _FirmwareCompilationManager2 = _interopRequireDefault(_FirmwareCompilationManager); - -var _allowUpload = require('../decorators/allowUpload'); - -var _allowUpload2 = _interopRequireDefault(_allowUpload); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -var _deviceToAPI = require('../lib/deviceToAPI'); - -var _deviceToAPI2 = _interopRequireDefault(_deviceToAPI); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var DevicesController = (_dec = (0, _httpVerb2.default)('post'), _dec2 = (0, _route2.default)('/v1/devices'), _dec3 = (0, _httpVerb2.default)('get'), _dec4 = (0, _route2.default)('/v1/binaries/:binaryID'), _dec5 = (0, _httpVerb2.default)('post'), _dec6 = (0, _route2.default)('/v1/binaries'), _dec7 = (0, _allowUpload2.default)(), _dec8 = (0, _httpVerb2.default)('delete'), _dec9 = (0, _route2.default)('/v1/devices/:deviceID'), _dec10 = (0, _httpVerb2.default)('get'), _dec11 = (0, _route2.default)('/v1/devices'), _dec12 = (0, _httpVerb2.default)('get'), _dec13 = (0, _route2.default)('/v1/devices/:deviceID'), _dec14 = (0, _httpVerb2.default)('get'), _dec15 = (0, _route2.default)('/v1/devices/:deviceID/:varName/'), _dec16 = (0, _httpVerb2.default)('put'), _dec17 = (0, _route2.default)('/v1/devices/:deviceID'), _dec18 = (0, _allowUpload2.default)('file', 1), _dec19 = (0, _httpVerb2.default)('post'), _dec20 = (0, _route2.default)('/v1/devices/:deviceID/:functionName'), (_class = function (_Controller) { - (0, _inherits3.default)(DevicesController, _Controller); - - function DevicesController(deviceManager) { - (0, _classCallCheck3.default)(this, DevicesController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (DevicesController.__proto__ || (0, _getPrototypeOf2.default)(DevicesController)).call(this)); - - _this._deviceManager = deviceManager; - return _this; - } - - (0, _createClass3.default)(DevicesController, [{ - key: 'claimDevice', - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(postBody) { - var deviceID; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - deviceID = postBody.id; - _context.next = 3; - return this._deviceManager.claimDevice(deviceID, this.user.id); - - case 3: - return _context.abrupt('return', this.ok({ ok: true })); - - case 4: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function claimDevice(_x) { - return _ref.apply(this, arguments); - } - - return claimDevice; - }() - }, { - key: 'getAppFirmware', - value: function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(binaryID) { - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - return _context2.abrupt('return', this.ok(_FirmwareCompilationManager2.default.getBinaryForID(binaryID))); - - case 1: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function getAppFirmware(_x2) { - return _ref2.apply(this, arguments); - } - - return getAppFirmware; - }() - }, { - key: 'compileSources', - value: function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(postBody) { - var response; - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return _FirmwareCompilationManager2.default.compileSource((0, _nullthrows2.default)(postBody.platform_id || postBody.product_id), this.request.files); - - case 2: - response = _context3.sent; - - if (response) { - _context3.next = 5; - break; - } - - throw new _HttpError2.default('Error during compilation'); - - case 5: - return _context3.abrupt('return', this.ok((0, _extends3.default)({}, response, { - binary_url: '/v1/binaries/' + response.binary_id, - ok: true - }))); - - case 6: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function compileSources(_x3) { - return _ref3.apply(this, arguments); - } - - return compileSources; - }() - }, { - key: 'unclaimDevice', - value: function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(deviceID) { - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return this._deviceManager.unclaimDevice(deviceID, this.user.id); - - case 2: - return _context4.abrupt('return', this.ok({ ok: true })); - - case 3: - case 'end': - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function unclaimDevice(_x4) { - return _ref4.apply(this, arguments); - } - - return unclaimDevice; - }() - }, { - key: 'getDevices', - value: function () { - var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5() { - var devices; - return _regenerator2.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _context5.prev = 0; - _context5.next = 3; - return this._deviceManager.getAll(this.user.id); - - case 3: - devices = _context5.sent; - return _context5.abrupt('return', this.ok(devices.map(function (device) { - return (0, _deviceToAPI2.default)(device); - }))); - - case 7: - _context5.prev = 7; - _context5.t0 = _context5['catch'](0); - return _context5.abrupt('return', this.ok([])); - - case 10: - case 'end': - return _context5.stop(); - } - } - }, _callee5, this, [[0, 7]]); - })); - - function getDevices() { - return _ref5.apply(this, arguments); - } - - return getDevices; - }() - }, { - key: 'getDevice', - value: function () { - var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(deviceID) { - var device; - return _regenerator2.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - _context6.next = 2; - return this._deviceManager.getDetailsByID(deviceID, this.user.id); - - case 2: - device = _context6.sent; - return _context6.abrupt('return', this.ok((0, _deviceToAPI2.default)(device))); - - case 4: - case 'end': - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function getDevice(_x5) { - return _ref6.apply(this, arguments); - } - - return getDevice; - }() - }, { - key: 'getVariableValue', - value: function () { - var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(deviceID, varName) { - var varValue, errorMessage; - return _regenerator2.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _context7.prev = 0; - _context7.next = 3; - return this._deviceManager.getVariableValue(deviceID, this.user.id, varName); - - case 3: - varValue = _context7.sent; - return _context7.abrupt('return', this.ok({ result: varValue })); - - case 7: - _context7.prev = 7; - _context7.t0 = _context7['catch'](0); - errorMessage = _context7.t0.message; - - if (!errorMessage.match('Variable not found')) { - _context7.next = 12; - break; - } - - throw new _HttpError2.default('Variable not found', 404); - - case 12: - throw _context7.t0; - - case 13: - case 'end': - return _context7.stop(); - } - } - }, _callee7, this, [[0, 7]]); - })); - - function getVariableValue(_x6, _x7) { - return _ref7.apply(this, arguments); - } - - return getVariableValue; - }() - }, { - key: 'updateDevice', - value: function () { - var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(deviceID, postBody) { - var updatedAttributes, flashStatus, file, _flashStatus; - - return _regenerator2.default.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - if (!postBody.name) { - _context8.next = 5; - break; - } - - _context8.next = 3; - return this._deviceManager.renameDevice(deviceID, this.user.id, postBody.name); - - case 3: - updatedAttributes = _context8.sent; - return _context8.abrupt('return', this.ok({ name: updatedAttributes.name, ok: true })); - - case 5: - if (!postBody.app_id) { - _context8.next = 10; - break; - } - - _context8.next = 8; - return this._deviceManager.flashKnownApp(deviceID, this.user.id, postBody.app_id); - - case 8: - flashStatus = _context8.sent; - return _context8.abrupt('return', this.ok({ id: deviceID, status: flashStatus })); - - case 10: - if (!(this.request.files && !this.request.files.file)) { - _context8.next = 12; - break; - } - - throw new Error('Firmware file not provided'); - - case 12: - file = this.request.files && this.request.files.file[0]; - - if (!(file && file.originalname.endsWith('.bin'))) { - _context8.next = 18; - break; - } - - _context8.next = 16; - return this._deviceManager.flashBinary(deviceID, file); - - case 16: - _flashStatus = _context8.sent; - return _context8.abrupt('return', this.ok({ id: deviceID, status: _flashStatus })); - - case 18: - if (!postBody.signal) { - _context8.next = 24; - break; - } - - if (['1', '0'].includes(postBody.signal)) { - _context8.next = 21; - break; - } - - throw new _HttpError2.default('Wrong signal value'); - - case 21: - _context8.next = 23; - return this._deviceManager.raiseYourHand(deviceID, this.user.id, !!parseInt(postBody.signal, 10)); - - case 23: - return _context8.abrupt('return', this.ok({ id: deviceID, ok: true })); - - case 24: - throw new _HttpError2.default('Did not update device'); - - case 25: - case 'end': - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function updateDevice(_x8, _x9) { - return _ref8.apply(this, arguments); - } - - return updateDevice; - }() - }, { - key: 'callDeviceFunction', - value: function () { - var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(deviceID, functionName, postBody) { - var result, device, errorMessage; - return _regenerator2.default.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - _context9.prev = 0; - _context9.next = 3; - return this._deviceManager.callFunction(deviceID, this.user.id, functionName, postBody); - - case 3: - result = _context9.sent; - _context9.next = 6; - return this._deviceManager.getByID(deviceID, this.user.id); - - case 6: - device = _context9.sent; - return _context9.abrupt('return', this.ok((0, _deviceToAPI2.default)(device, result))); - - case 10: - _context9.prev = 10; - _context9.t0 = _context9['catch'](0); - errorMessage = _context9.t0.message; - - if (!(errorMessage.indexOf('Unknown Function') >= 0)) { - _context9.next = 15; - break; - } - - throw new _HttpError2.default('Function not found', 404); - - case 15: - throw _context9.t0; - - case 16: - case 'end': - return _context9.stop(); - } - } - }, _callee9, this, [[0, 10]]); - })); - - function callDeviceFunction(_x10, _x11, _x12) { - return _ref9.apply(this, arguments); - } - - return callDeviceFunction; - }() - }]); - return DevicesController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'claimDevice', [_dec, _dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'claimDevice'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getAppFirmware', [_dec3, _dec4], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getAppFirmware'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'compileSources', [_dec5, _dec6, _dec7], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'compileSources'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'unclaimDevice', [_dec8, _dec9], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'unclaimDevice'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getDevices', [_dec10, _dec11], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getDevices'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getDevice', [_dec12, _dec13], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getDevice'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getVariableValue', [_dec14, _dec15], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getVariableValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'updateDevice', [_dec16, _dec17, _dec18], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'updateDevice'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'callDeviceFunction', [_dec19, _dec20], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'callDeviceFunction'), _class.prototype)), _class)); -exports.default = DevicesController; \ No newline at end of file diff --git a/dist/controllers/EventsController.js b/dist/controllers/EventsController.js deleted file mode 100644 index 4860098e..00000000 --- a/dist/controllers/EventsController.js +++ /dev/null @@ -1,278 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _stringify = require('babel-runtime/core-js/json/stringify'); - -var _stringify2 = _interopRequireDefault(_stringify); - -var _promise = require('babel-runtime/core-js/promise'); - -var _promise2 = _interopRequireDefault(_promise); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _desc, _value, _class; - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _serverSentEvents = require('../decorators/serverSentEvents'); - -var _serverSentEvents2 = _interopRequireDefault(_serverSentEvents); - -var _logger = require('../lib/logger'); - -var _logger2 = _interopRequireDefault(_logger); - -var _eventToApi = require('../lib/eventToApi'); - -var _eventToApi2 = _interopRequireDefault(_eventToApi); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var EventsController = (_dec = (0, _httpVerb2.default)('get'), _dec2 = (0, _route2.default)('/v1/events/:eventNamePrefix?*'), _dec3 = (0, _serverSentEvents2.default)(), _dec4 = (0, _httpVerb2.default)('get'), _dec5 = (0, _route2.default)('/v1/devices/events/:eventNamePrefix?*'), _dec6 = (0, _serverSentEvents2.default)(), _dec7 = (0, _httpVerb2.default)('get'), _dec8 = (0, _route2.default)('/v1/devices/:deviceID/events/:eventNamePrefix?*'), _dec9 = (0, _serverSentEvents2.default)(), _dec10 = (0, _httpVerb2.default)('post'), _dec11 = (0, _route2.default)('/v1/devices/events'), (_class = function (_Controller) { - (0, _inherits3.default)(EventsController, _Controller); - - function EventsController(eventManager) { - (0, _classCallCheck3.default)(this, EventsController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (EventsController.__proto__ || (0, _getPrototypeOf2.default)(EventsController)).call(this)); - - _this._eventManager = eventManager; - return _this; - } - - (0, _createClass3.default)(EventsController, [{ - key: '_closeStream', - value: function _closeStream(subscriptionID) { - var _this2 = this; - - return new _promise2.default(function (resolve) { - var closeStreamHandler = function closeStreamHandler() { - _this2._eventManager.unsubscribe(subscriptionID); - resolve(); - }; - - _this2.request.on('close', closeStreamHandler); - _this2.request.on('end', closeStreamHandler); - _this2.response.on('finish', closeStreamHandler); - _this2.response.on('end', closeStreamHandler); - }); - } - }, { - key: '_pipeEvent', - value: function _pipeEvent(event) { - try { - this.response.write('event: ' + event.name + '\n'); - this.response.write('data: ' + (0, _stringify2.default)((0, _eventToApi2.default)(event)) + '\n\n'); - } catch (error) { - _logger2.default.error('pipeEvents - write error: ' + error); - throw error; - } - } - }, { - key: 'getEvents', - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(eventNamePrefix) { - var subscriptionID; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - subscriptionID = this._eventManager.subscribe(eventNamePrefix, this._pipeEvent.bind(this), { userID: this.user.id }); - _context.next = 3; - return this._closeStream(subscriptionID); - - case 3: - return _context.abrupt('return', this.ok()); - - case 4: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function getEvents(_x) { - return _ref.apply(this, arguments); - } - - return getEvents; - }() - }, { - key: 'getMyEvents', - value: function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(eventNamePrefix) { - var subscriptionID; - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - subscriptionID = this._eventManager.subscribe(eventNamePrefix, this._pipeEvent.bind(this), { - mydevices: true, - userID: this.user.id - }); - _context2.next = 3; - return this._closeStream(subscriptionID); - - case 3: - return _context2.abrupt('return', this.ok()); - - case 4: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function getMyEvents(_x2) { - return _ref2.apply(this, arguments); - } - - return getMyEvents; - }() - }, { - key: 'getDeviceEvents', - value: function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(deviceID, eventNamePrefix) { - var subscriptionID; - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - subscriptionID = this._eventManager.subscribe(eventNamePrefix, this._pipeEvent.bind(this), { - deviceID: deviceID, - userID: this.user.id - }); - _context3.next = 3; - return this._closeStream(subscriptionID); - - case 3: - return _context3.abrupt('return', this.ok()); - - case 4: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function getDeviceEvents(_x3, _x4) { - return _ref3.apply(this, arguments); - } - - return getDeviceEvents; - }() - }, { - key: 'publish', - value: function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(postBody) { - var eventData; - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - eventData = { - data: postBody.data, - isPublic: !postBody.private, - name: postBody.name, - ttl: postBody.ttl, - userID: this.user.id - }; - - - this._eventManager.publish(eventData); - return _context4.abrupt('return', this.ok({ ok: true })); - - case 3: - case 'end': - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function publish(_x5) { - return _ref4.apply(this, arguments); - } - - return publish; - }() - }]); - return EventsController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'getEvents', [_dec, _dec2, _dec3], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getEvents'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getMyEvents', [_dec4, _dec5, _dec6], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getMyEvents'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getDeviceEvents', [_dec7, _dec8, _dec9], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getDeviceEvents'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'publish', [_dec10, _dec11], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'publish'), _class.prototype)), _class)); -exports.default = EventsController; \ No newline at end of file diff --git a/dist/controllers/OauthClientsController.js b/dist/controllers/OauthClientsController.js deleted file mode 100644 index 69a818aa..00000000 --- a/dist/controllers/OauthClientsController.js +++ /dev/null @@ -1,177 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _desc, _value, _class; - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var OauthClientsController = (_dec = (0, _httpVerb2.default)('post'), _dec2 = (0, _route2.default)('/v1/products/:productIDorSlug/clients/'), _dec3 = (0, _httpVerb2.default)('put'), _dec4 = (0, _route2.default)('/v1/products/:productIDorSlug/clients/:clientID'), _dec5 = (0, _httpVerb2.default)('delete'), _dec6 = (0, _route2.default)('/v1/products/:productIDorSlug/clients/:clientID'), (_class = function (_Controller) { - (0, _inherits3.default)(OauthClientsController, _Controller); - - function OauthClientsController() { - (0, _classCallCheck3.default)(this, OauthClientsController); - return (0, _possibleConstructorReturn3.default)(this, (OauthClientsController.__proto__ || (0, _getPrototypeOf2.default)(OauthClientsController)).apply(this, arguments)); - } - - (0, _createClass3.default)(OauthClientsController, [{ - key: 'createClient', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function createClient() { - return _ref.apply(this, arguments); - } - - return createClient; - }() - }, { - key: 'editClient', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2() { - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function editClient() { - return _ref2.apply(this, arguments); - } - - return editClient; - }() - }, { - key: 'deleteClient', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() { - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function deleteClient() { - return _ref3.apply(this, arguments); - } - - return deleteClient; - }() - }]); - return OauthClientsController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'createClient', [_dec, _dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'createClient'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'editClient', [_dec3, _dec4], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'editClient'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'deleteClient', [_dec5, _dec6], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'deleteClient'), _class.prototype)), _class)); -exports.default = OauthClientsController; \ No newline at end of file diff --git a/dist/controllers/ProductsController.js b/dist/controllers/ProductsController.js deleted file mode 100644 index e9382aa3..00000000 --- a/dist/controllers/ProductsController.js +++ /dev/null @@ -1,406 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _desc, _value, _class; -/* eslint-disable */ - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var ProductsController = (_dec = (0, _httpVerb2.default)('get'), _dec2 = (0, _route2.default)('/v1/products'), _dec3 = (0, _httpVerb2.default)('post'), _dec4 = (0, _route2.default)('/v1/products'), _dec5 = (0, _httpVerb2.default)('get'), _dec6 = (0, _route2.default)('/v1/products/:productIdOrSlug'), _dec7 = (0, _httpVerb2.default)('post'), _dec8 = (0, _route2.default)('/v1/products/:productIdOrSlug/device_claims'), _dec9 = (0, _httpVerb2.default)('get'), _dec10 = (0, _route2.default)('/v1/products/:productIdOrSlug/firmware'), _dec11 = (0, _httpVerb2.default)('post'), _dec12 = (0, _route2.default)('/v1/products/:productIdOrSlug/firmware'), _dec13 = (0, _httpVerb2.default)('get'), _dec14 = (0, _route2.default)('/v1/products/:productIdOrSlug/devices'), _dec15 = (0, _httpVerb2.default)('put'), _dec16 = (0, _route2.default)('/v1/products/:productIdOrSlug/devices/:deviceID'), _dec17 = (0, _httpVerb2.default)('delete'), _dec18 = (0, _route2.default)('/v1/products/:productIdOrSlug/devices/:deviceID'), _dec19 = (0, _httpVerb2.default)('get'), _dec20 = (0, _route2.default)('/v1/products/:productIdOrSlug/config'), _dec21 = (0, _httpVerb2.default)('get'), _dec22 = (0, _route2.default)('/v1/products/:productIdOrSlug/events/:eventPrefix?*'), _dec23 = (0, _httpVerb2.default)('delete'), _dec24 = (0, _route2.default)('/v1/products/:productIdOrSlug/team/:username'), (_class = function (_Controller) { - (0, _inherits3.default)(ProductsController, _Controller); - - function ProductsController(deviceManager) { - (0, _classCallCheck3.default)(this, ProductsController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (ProductsController.__proto__ || (0, _getPrototypeOf2.default)(ProductsController)).call(this)); - - _this._deviceManager = deviceManager; - return _this; - } - - (0, _createClass3.default)(ProductsController, [{ - key: 'getProducts', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function getProducts() { - return _ref.apply(this, arguments); - } - - return getProducts; - }() - }, { - key: 'createProduct', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2() { - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function createProduct() { - return _ref2.apply(this, arguments); - } - - return createProduct; - }() - }, { - key: 'getProduct', - value: function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(productIdOrSlug) { - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function getProduct(_x) { - return _ref3.apply(this, arguments); - } - - return getProduct; - }() - }, { - key: 'generateClaimCode', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(productIdOrSlug) { - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function generateClaimCode(_x2) { - return _ref4.apply(this, arguments); - } - - return generateClaimCode; - }() - }, { - key: 'getFirmware', - value: function () { - var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(productIdOrSlug) { - return _regenerator2.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context5.stop(); - } - } - }, _callee5, this); - })); - - function getFirmware(_x3) { - return _ref5.apply(this, arguments); - } - - return getFirmware; - }() - - // {version: number, name: 'current', binary: File, title: string, description: string} - - }, { - key: 'getFirmware', - value: function () { - var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(productIdOrSlug) { - return _regenerator2.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function getFirmware(_x4) { - return _ref6.apply(this, arguments); - } - - return getFirmware; - }() - }, { - key: 'getDevices', - value: function () { - var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(productIdOrSlug) { - return _regenerator2.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function getDevices(_x5) { - return _ref7.apply(this, arguments); - } - - return getDevices; - }() - }, { - key: 'setFirmwareVersion', - value: function () { - var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(productIdOrSlug, deviceID, body) { - return _regenerator2.default.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function setFirmwareVersion(_x6, _x7, _x8) { - return _ref8.apply(this, arguments); - } - - return setFirmwareVersion; - }() - }, { - key: 'removeDeviceFromProduct', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(productIdOrSlug, deviceID) { - return _regenerator2.default.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context9.stop(); - } - } - }, _callee9, this); - })); - - function removeDeviceFromProduct(_x9, _x10) { - return _ref9.apply(this, arguments); - } - - return removeDeviceFromProduct; - }() - }, { - key: 'getConfig', - value: function () { - var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(productIdOrSlug) { - return _regenerator2.default.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context10.stop(); - } - } - }, _callee10, this); - })); - - function getConfig(_x11) { - return _ref10.apply(this, arguments); - } - - return getConfig; - }() - }, { - key: 'getEvents', - value: function () { - var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(productIdOrSlug, eventName) { - return _regenerator2.default.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context11.stop(); - } - } - }, _callee11, this); - })); - - function getEvents(_x12, _x13) { - return _ref11.apply(this, arguments); - } - - return getEvents; - }() - }, { - key: 'removeTeamMember', - - // eslint-disable-next-line class-methods-use-this - value: function () { - var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(productIdOrSlug, username) { - return _regenerator2.default.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - throw new _HttpError2.default('not supported in the current server version'); - - case 1: - case 'end': - return _context12.stop(); - } - } - }, _callee12, this); - })); - - function removeTeamMember(_x14, _x15) { - return _ref12.apply(this, arguments); - } - - return removeTeamMember; - }() - }]); - return ProductsController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'getProducts', [_dec, _dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getProducts'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'createProduct', [_dec3, _dec4], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'createProduct'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getProduct', [_dec5, _dec6], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getProduct'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'generateClaimCode', [_dec7, _dec8], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'generateClaimCode'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getFirmware', [_dec9, _dec10], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getFirmware'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getFirmware', [_dec11, _dec12], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getFirmware'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getDevices', [_dec13, _dec14], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getDevices'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'setFirmwareVersion', [_dec15, _dec16], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'setFirmwareVersion'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'removeDeviceFromProduct', [_dec17, _dec18], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'removeDeviceFromProduct'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getConfig', [_dec19, _dec20], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getConfig'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getEvents', [_dec21, _dec22], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getEvents'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'removeTeamMember', [_dec23, _dec24], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'removeTeamMember'), _class.prototype)), _class)); -exports.default = ProductsController; -/* eslint-enable */ \ No newline at end of file diff --git a/dist/controllers/ProvisioningController.js b/dist/controllers/ProvisioningController.js deleted file mode 100644 index 88ffdb80..00000000 --- a/dist/controllers/ProvisioningController.js +++ /dev/null @@ -1,145 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _desc, _value, _class; - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -var _deviceToAPI = require('../lib/deviceToAPI'); - -var _deviceToAPI2 = _interopRequireDefault(_deviceToAPI); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var ProvisioningController = (_dec = (0, _httpVerb2.default)('post'), _dec2 = (0, _route2.default)('/v1/provisioning/:coreID'), (_class = function (_Controller) { - (0, _inherits3.default)(ProvisioningController, _Controller); - - function ProvisioningController(deviceManager) { - (0, _classCallCheck3.default)(this, ProvisioningController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (ProvisioningController.__proto__ || (0, _getPrototypeOf2.default)(ProvisioningController)).call(this)); - - _this._deviceManager = deviceManager; - return _this; - } - - (0, _createClass3.default)(ProvisioningController, [{ - key: 'provision', - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(coreID, postBody) { - var device; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (postBody.publicKey) { - _context.next = 2; - break; - } - - throw new _HttpError2.default('No key provided'); - - case 2: - _context.next = 4; - return this._deviceManager.provision(coreID, this.user.id, postBody.publicKey); - - case 4: - device = _context.sent; - return _context.abrupt('return', this.ok((0, _deviceToAPI2.default)(device))); - - case 6: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function provision(_x, _x2) { - return _ref.apply(this, arguments); - } - - return provision; - }() - }]); - return ProvisioningController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'provision', [_dec, _dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'provision'), _class.prototype)), _class)); -exports.default = ProvisioningController; \ No newline at end of file diff --git a/dist/controllers/UsersController.js b/dist/controllers/UsersController.js deleted file mode 100644 index 6b9179d4..00000000 --- a/dist/controllers/UsersController.js +++ /dev/null @@ -1,228 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _desc, _value, _class; - -var _basicAuthParser3 = require('basic-auth-parser'); - -var _basicAuthParser4 = _interopRequireDefault(_basicAuthParser3); - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -var _anonymous = require('../decorators/anonymous'); - -var _anonymous2 = _interopRequireDefault(_anonymous); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var UsersController = (_dec = (0, _httpVerb2.default)('post'), _dec2 = (0, _route2.default)('/v1/users'), _dec3 = (0, _anonymous2.default)(), _dec4 = (0, _httpVerb2.default)('delete'), _dec5 = (0, _route2.default)('/v1/access_tokens/:token'), _dec6 = (0, _anonymous2.default)(), _dec7 = (0, _httpVerb2.default)('get'), _dec8 = (0, _route2.default)('/v1/access_tokens'), _dec9 = (0, _anonymous2.default)(), (_class = function (_Controller) { - (0, _inherits3.default)(UsersController, _Controller); - - function UsersController(userRepository) { - (0, _classCallCheck3.default)(this, UsersController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (UsersController.__proto__ || (0, _getPrototypeOf2.default)(UsersController)).call(this)); - - _this._userRepository = userRepository; - return _this; - } - - (0, _createClass3.default)(UsersController, [{ - key: 'createUser', - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(userCredentials) { - var isUserNameInUse; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.prev = 0; - _context.next = 3; - return this._userRepository.isUserNameInUse(userCredentials.username); - - case 3: - isUserNameInUse = _context.sent; - - if (!isUserNameInUse) { - _context.next = 6; - break; - } - - throw new _HttpError2.default('user with the username already exists'); - - case 6: - _context.next = 8; - return this._userRepository.createWithCredentials(userCredentials); - - case 8: - return _context.abrupt('return', this.ok({ ok: true })); - - case 11: - _context.prev = 11; - _context.t0 = _context['catch'](0); - return _context.abrupt('return', this.bad(_context.t0.message)); - - case 14: - case 'end': - return _context.stop(); - } - } - }, _callee, this, [[0, 11]]); - })); - - function createUser(_x) { - return _ref.apply(this, arguments); - } - - return createUser; - }() - }, { - key: 'deleteAccessToken', - value: function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(token) { - var _basicAuthParser, username, password, user; - - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _basicAuthParser = (0, _basicAuthParser4.default)(this.request.get('authorization')), username = _basicAuthParser.username, password = _basicAuthParser.password; - _context2.next = 3; - return this._userRepository.validateLogin(username, password); - - case 3: - user = _context2.sent; - - - this._userRepository.deleteAccessToken(user.id, token); - - return _context2.abrupt('return', this.ok({ ok: true })); - - case 6: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function deleteAccessToken(_x2) { - return _ref2.apply(this, arguments); - } - - return deleteAccessToken; - }() - }, { - key: 'getAccessTokens', - value: function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() { - var _basicAuthParser2, username, password, user; - - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _basicAuthParser2 = (0, _basicAuthParser4.default)(this.request.get('authorization')), username = _basicAuthParser2.username, password = _basicAuthParser2.password; - _context3.next = 3; - return this._userRepository.validateLogin(username, password); - - case 3: - user = _context3.sent; - return _context3.abrupt('return', this.ok(user.accessTokens)); - - case 5: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function getAccessTokens() { - return _ref3.apply(this, arguments); - } - - return getAccessTokens; - }() - }]); - return UsersController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'createUser', [_dec, _dec2, _dec3], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'createUser'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'deleteAccessToken', [_dec4, _dec5, _dec6], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'deleteAccessToken'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getAccessTokens', [_dec7, _dec8, _dec9], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getAccessTokens'), _class.prototype)), _class)); -exports.default = UsersController; \ No newline at end of file diff --git a/dist/controllers/WebhooksController.js b/dist/controllers/WebhooksController.js deleted file mode 100644 index ebcc9292..00000000 --- a/dist/controllers/WebhooksController.js +++ /dev/null @@ -1,257 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _extends2 = require('babel-runtime/helpers/extends'); - -var _extends3 = _interopRequireDefault(_extends2); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _desc, _value, _class; - -var _Controller2 = require('./Controller'); - -var _Controller3 = _interopRequireDefault(_Controller2); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -var _httpVerb = require('../decorators/httpVerb'); - -var _httpVerb2 = _interopRequireDefault(_httpVerb); - -var _route = require('../decorators/route'); - -var _route2 = _interopRequireDefault(_route); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var validateWebhookMutator = function validateWebhookMutator(webhookMutator) { - if (!webhookMutator.event) { - return new _HttpError2.default('no event name provided'); - } - if (!webhookMutator.url) { - return new _HttpError2.default('no url provided'); - } - if (!webhookMutator.requestType) { - return new _HttpError2.default('no requestType provided'); - } - - return null; -}; - -var WebhooksController = (_dec = (0, _httpVerb2.default)('get'), _dec2 = (0, _route2.default)('/v1/webhooks'), _dec3 = (0, _httpVerb2.default)('get'), _dec4 = (0, _route2.default)('/v1/webhooks/:webhookId'), _dec5 = (0, _httpVerb2.default)('post'), _dec6 = (0, _route2.default)('/v1/webhooks'), _dec7 = (0, _httpVerb2.default)('delete'), _dec8 = (0, _route2.default)('/v1/webhooks/:webhookId'), (_class = function (_Controller) { - (0, _inherits3.default)(WebhooksController, _Controller); - - function WebhooksController(webhookManager) { - (0, _classCallCheck3.default)(this, WebhooksController); - - var _this = (0, _possibleConstructorReturn3.default)(this, (WebhooksController.__proto__ || (0, _getPrototypeOf2.default)(WebhooksController)).call(this)); - - _this._webhookManager = webhookManager; - return _this; - } - - (0, _createClass3.default)(WebhooksController, [{ - key: 'getAll', - value: function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.t0 = this; - _context.next = 3; - return this._webhookManager.getAll(this.user.id); - - case 3: - _context.t1 = _context.sent; - return _context.abrupt('return', _context.t0.ok.call(_context.t0, _context.t1)); - - case 5: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - - function getAll() { - return _ref.apply(this, arguments); - } - - return getAll; - }() - }, { - key: 'getById', - value: function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(webhookId) { - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.t0 = this; - _context2.next = 3; - return this._webhookManager.getByID(webhookId, this.user.id); - - case 3: - _context2.t1 = _context2.sent; - return _context2.abrupt('return', _context2.t0.ok.call(_context2.t0, _context2.t1)); - - case 5: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this); - })); - - function getById(_x) { - return _ref2.apply(this, arguments); - } - - return getById; - }() - }, { - key: 'create', - value: function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(model) { - var validateError, newWebhook; - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - validateError = validateWebhookMutator(model); - - if (!validateError) { - _context3.next = 3; - break; - } - - throw validateError; - - case 3: - _context3.next = 5; - return this._webhookManager.create((0, _extends3.default)({}, model, { - ownerID: this.user.id - })); - - case 5: - newWebhook = _context3.sent; - return _context3.abrupt('return', this.ok({ - created_at: newWebhook.created_at, - event: newWebhook.event, - id: newWebhook.id, - ok: true, - url: newWebhook.url - })); - - case 7: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this); - })); - - function create(_x2) { - return _ref3.apply(this, arguments); - } - - return create; - }() - }, { - key: 'deleteById', - value: function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(webhookId) { - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return this._webhookManager.deleteByID(webhookId, this.user.id); - - case 2: - return _context4.abrupt('return', this.ok({ ok: true })); - - case 3: - case 'end': - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function deleteById(_x3) { - return _ref4.apply(this, arguments); - } - - return deleteById; - }() - }]); - return WebhooksController; -}(_Controller3.default), (_applyDecoratedDescriptor(_class.prototype, 'getAll', [_dec, _dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getAll'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getById', [_dec3, _dec4], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getById'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'create', [_dec5, _dec6], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'create'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'deleteById', [_dec7, _dec8], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'deleteById'), _class.prototype)), _class)); -exports.default = WebhooksController; \ No newline at end of file diff --git a/dist/controllers/types.js b/dist/controllers/types.js deleted file mode 100644 index 9a390c31..00000000 --- a/dist/controllers/types.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; \ No newline at end of file diff --git a/dist/decorators/allowUpload.js b/dist/decorators/allowUpload.js deleted file mode 100644 index 700de3f9..00000000 --- a/dist/decorators/allowUpload.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/* eslint-disable no-param-reassign */ -exports.default = function () { - var fileName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - var maxCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - return function (target, name, descriptor) { - var allowedUploads = target[name].allowedUploads || []; - if (fileName) { - allowedUploads.push({ - maxCount: maxCount, - name: fileName - }); - } - - target[name].allowedUploads = allowedUploads; - return descriptor; - }; -}; \ No newline at end of file diff --git a/dist/decorators/anonymous.js b/dist/decorators/anonymous.js deleted file mode 100644 index d139c96e..00000000 --- a/dist/decorators/anonymous.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/* eslint-disable no-param-reassign */ -exports.default = function () { - return function (target, name, descriptor) { - target[name].anonymous = true; - return descriptor; - }; -}; \ No newline at end of file diff --git a/dist/decorators/httpVerb.js b/dist/decorators/httpVerb.js deleted file mode 100644 index 09aac162..00000000 --- a/dist/decorators/httpVerb.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/* eslint-disable no-param-reassign */ -exports.default = function (httpVerb) { - return function (target, name, descriptor) { - target[name].httpVerb = httpVerb; - return descriptor; - }; -}; \ No newline at end of file diff --git a/dist/decorators/route.js b/dist/decorators/route.js deleted file mode 100644 index 0cbce75e..00000000 --- a/dist/decorators/route.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/* eslint-disable no-param-reassign */ -exports.default = function (route) { - return function (target, name, descriptor) { - target[name].route = route; - return descriptor; - }; -}; \ No newline at end of file diff --git a/dist/decorators/serverSentEvents.js b/dist/decorators/serverSentEvents.js deleted file mode 100644 index bdd4ea05..00000000 --- a/dist/decorators/serverSentEvents.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/* eslint-disable no-param-reassign */ -exports.default = function () { - return function (target, name, descriptor) { - target[name].serverSentEvents = true; - return descriptor; - }; -}; \ No newline at end of file diff --git a/dist/decorators/types.js b/dist/decorators/types.js deleted file mode 100644 index a726efc4..00000000 --- a/dist/decorators/types.js +++ /dev/null @@ -1 +0,0 @@ -'use strict'; \ No newline at end of file diff --git a/dist/defaultBindings.js b/dist/defaultBindings.js deleted file mode 100644 index fe4a0cd6..00000000 --- a/dist/defaultBindings.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _keys = require('babel-runtime/core-js/object/keys'); - -var _keys2 = _interopRequireDefault(_keys); - -var _sparkProtocol = require('spark-protocol'); - -var _DeviceClaimsController = require('./controllers/DeviceClaimsController'); - -var _DeviceClaimsController2 = _interopRequireDefault(_DeviceClaimsController); - -var _DevicesController = require('./controllers/DevicesController'); - -var _DevicesController2 = _interopRequireDefault(_DevicesController); - -var _EventsController = require('./controllers/EventsController'); - -var _EventsController2 = _interopRequireDefault(_EventsController); - -var _OauthClientsController = require('./controllers/OauthClientsController'); - -var _OauthClientsController2 = _interopRequireDefault(_OauthClientsController); - -var _ProductsController = require('./controllers/ProductsController'); - -var _ProductsController2 = _interopRequireDefault(_ProductsController); - -var _ProvisioningController = require('./controllers/ProvisioningController'); - -var _ProvisioningController2 = _interopRequireDefault(_ProvisioningController); - -var _UsersController = require('./controllers/UsersController'); - -var _UsersController2 = _interopRequireDefault(_UsersController); - -var _WebhooksController = require('./controllers/WebhooksController'); - -var _WebhooksController2 = _interopRequireDefault(_WebhooksController); - -var _WebhookManager = require('./managers/WebhookManager'); - -var _WebhookManager2 = _interopRequireDefault(_WebhookManager); - -var _EventManager = require('./managers/EventManager'); - -var _EventManager2 = _interopRequireDefault(_EventManager); - -var _DeviceFirmwareFileRepository = require('./repository/DeviceFirmwareFileRepository'); - -var _DeviceFirmwareFileRepository2 = _interopRequireDefault(_DeviceFirmwareFileRepository); - -var _DeviceManager = require('./managers/DeviceManager'); - -var _DeviceManager2 = _interopRequireDefault(_DeviceManager); - -var _UserFileRepository = require('./repository/UserFileRepository'); - -var _UserFileRepository2 = _interopRequireDefault(_UserFileRepository); - -var _WebhookFileRepository = require('./repository/WebhookFileRepository'); - -var _WebhookFileRepository2 = _interopRequireDefault(_WebhookFileRepository); - -var _settings = require('./settings'); - -var _settings2 = _interopRequireDefault(_settings); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (container, newSettings) { - // Make sure that the spark-server settings match whatever is passed in - (0, _keys2.default)(newSettings).forEach(function (key) { - _settings2.default[key] = newSettings[key]; - }); - - // spark protocol container bindings - (0, _sparkProtocol.defaultBindings)(container, newSettings); - - // settings - container.bindValue('DEVICE_DIRECTORY', _settings2.default.DEVICE_DIRECTORY); - container.bindValue('FIRMWARE_DIRECTORY', _settings2.default.FIRMWARE_DIRECTORY); - container.bindValue('SERVER_KEY_FILENAME', _settings2.default.SERVER_KEY_FILENAME); - container.bindValue('SERVER_KEYS_DIRECTORY', _settings2.default.SERVER_KEYS_DIRECTORY); - container.bindValue('USERS_DIRECTORY', _settings2.default.USERS_DIRECTORY); - container.bindValue('WEBHOOKS_DIRECTORY', _settings2.default.WEBHOOKS_DIRECTORY); - - // controllers - container.bindClass('DeviceClaimsController', _DeviceClaimsController2.default, ['DeviceManager', 'ClaimCodeManager']); - container.bindClass('DevicesController', _DevicesController2.default, ['DeviceManager']); - container.bindClass('EventsController', _EventsController2.default, ['EventManager']); - container.bindClass('OauthClientsController', _OauthClientsController2.default, []); - container.bindClass('ProductsController', _ProductsController2.default, []); - container.bindClass('ProvisioningController', _ProvisioningController2.default, ['DeviceManager']); - container.bindClass('UsersController', _UsersController2.default, ['UserRepository']); - container.bindClass('WebhooksController', _WebhooksController2.default, ['WebhookManager']); - - // managers - container.bindClass('DeviceManager', _DeviceManager2.default, ['DeviceAttributeRepository', 'DeviceFirmwareRepository', 'DeviceKeyRepository', 'DeviceServer']); - container.bindClass('EventManager', _EventManager2.default, ['EventPublisher']); - container.bindClass('WebhookManager', _WebhookManager2.default, ['WebhookRepository', 'EventPublisher']); - - // Repositories - container.bindClass('DeviceFirmwareRepository', _DeviceFirmwareFileRepository2.default, ['FIRMWARE_DIRECTORY']); - container.bindClass('UserRepository', _UserFileRepository2.default, ['USERS_DIRECTORY']); - container.bindClass('WebhookRepository', _WebhookFileRepository2.default, ['WEBHOOKS_DIRECTORY']); -}; \ No newline at end of file diff --git a/dist/exports.js b/dist/exports.js deleted file mode 100644 index a7506238..00000000 --- a/dist/exports.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.settings = exports.logger = exports.defaultBindings = exports.createApp = undefined; - -var _logger = require('./lib/logger'); - -var _logger2 = _interopRequireDefault(_logger); - -var _app = require('./app'); - -var _app2 = _interopRequireDefault(_app); - -var _defaultBindings = require('./defaultBindings'); - -var _defaultBindings2 = _interopRequireDefault(_defaultBindings); - -var _settings = require('./settings'); - -var _settings2 = _interopRequireDefault(_settings); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.createApp = _app2.default; -exports.defaultBindings = _defaultBindings2.default; -exports.logger = _logger2.default; -exports.settings = _settings2.default; \ No newline at end of file diff --git a/dist/lib/HttpError.js b/dist/lib/HttpError.js deleted file mode 100644 index e133f7ec..00000000 --- a/dist/lib/HttpError.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = require('babel-runtime/helpers/inherits'); - -var _inherits3 = _interopRequireDefault(_inherits2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var HttpError = function (_Error) { - (0, _inherits3.default)(HttpError, _Error); - - function HttpError(error) { - var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400; - (0, _classCallCheck3.default)(this, HttpError); - - var _this = (0, _possibleConstructorReturn3.default)(this, (HttpError.__proto__ || (0, _getPrototypeOf2.default)(HttpError)).call(this, error.message || error)); - - if (typeof error.status === 'number') { - _this.status = error.status; - } else { - _this.status = status; - } - return _this; - } - - return HttpError; -}(Error); - -exports.default = HttpError; \ No newline at end of file diff --git a/dist/lib/PasswordHasher.js b/dist/lib/PasswordHasher.js deleted file mode 100644 index 52d90470..00000000 --- a/dist/lib/PasswordHasher.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _promise = require('babel-runtime/core-js/promise'); - -var _promise2 = _interopRequireDefault(_promise); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _crypto = require('crypto'); - -var _crypto2 = _interopRequireDefault(_crypto); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var HASH_DIGEST = 'sha256'; /** - * Copyright (C) 2013-2014 Spark Labs, Inc. All rights reserved. - https://www.spark.io/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * You can download the source here: https://github.com/spark/spark-server - * - * - * - */ - -var HASH_ITERATIONS = 30000; -var KEY_LENGTH = 64; - -var PasswordHasher = function () { - function PasswordHasher() { - (0, _classCallCheck3.default)(this, PasswordHasher); - } - - (0, _createClass3.default)(PasswordHasher, null, [{ - key: 'generateSalt', - value: function generateSalt() { - var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 64; - - return new _promise2.default(function (resolve, reject) { - _crypto2.default.randomBytes(size, function (error, buffer) { - if (error) { - reject(error); - return; - } - resolve(buffer.toString('base64')); - }); - }); - } - }, { - key: 'hash', - value: function hash(password, salt) { - return new _promise2.default(function (resolve, reject) { - _crypto2.default.pbkdf2(password, salt, HASH_ITERATIONS, KEY_LENGTH, HASH_DIGEST, function (error, key) { - if (error) { - reject(error); - return; - } - resolve(key.toString('base64')); - }); - }); - } - }]); - return PasswordHasher; -}(); - -exports.default = PasswordHasher; \ No newline at end of file diff --git a/dist/lib/deviceToAPI.js b/dist/lib/deviceToAPI.js deleted file mode 100644 index d332c6ab..00000000 --- a/dist/lib/deviceToAPI.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var deviceToAPI = function deviceToAPI(device, result) { - return { - cellular: device.isCellular, - connected: device.connected, - current_build_target: device.currentBuildTarget, - functions: device.functions, - id: device.deviceID, - imei: device.imei, - last_app: device.lastFlashedAppName, - last_heard: device.lastHeard, - last_iccid: device.last_iccid, - last_ip_address: device.ip, - name: device.name, - platform_id: device.particleProductId, - product_id: device.particleProductId, - return_value: result, - status: 'normal', - variables: device.variables - }; -}; - -exports.default = deviceToAPI; \ No newline at end of file diff --git a/dist/lib/eventToApi.js b/dist/lib/eventToApi.js deleted file mode 100644 index 10e30672..00000000 --- a/dist/lib/eventToApi.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var eventToApi = function eventToApi(event) { - return { - coreid: event.deviceID || null, - data: event.data || null, - published_at: event.publishedAt, - ttl: event.ttl - }; -}; - -exports.default = eventToApi; \ No newline at end of file diff --git a/dist/lib/logger.js b/dist/lib/logger.js deleted file mode 100644 index 17958cd0..00000000 --- a/dist/lib/logger.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require("babel-runtime/helpers/createClass"); - -var _createClass3 = _interopRequireDefault(_createClass2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** -* Copyright (C) 2013-2014 Spark Labs, Inc. All rights reserved. - https://www.spark.io/ -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License, version 3, -* as published by the Free Software Foundation. -* -* 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 Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see . -* -* You can download the source here: https://github.com/spark/spark-server -* -* -* -*/ - -var Logger = function () { - function Logger() { - (0, _classCallCheck3.default)(this, Logger); - } - - (0, _createClass3.default)(Logger, null, [{ - key: "log", - value: function log() { - var _console; - - // eslint-disable-next-line prefer-rest-params - (_console = console).log.apply(_console, arguments); - } - }, { - key: "error", - value: function error() { - var _console2; - - // eslint-disable-next-line prefer-rest-params - (_console2 = console).error.apply(_console2, arguments); - } - }]); - return Logger; -}(); - -exports.default = Logger; \ No newline at end of file diff --git a/dist/main.js b/dist/main.js deleted file mode 100644 index fa4fa388..00000000 --- a/dist/main.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); - -var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - -var _entries = require('babel-runtime/core-js/object/entries'); - -var _entries2 = _interopRequireDefault(_entries); - -var _constitute = require('constitute'); - -var _os = require('os'); - -var _os2 = _interopRequireDefault(_os); - -var _arrayFlatten = require('array-flatten'); - -var _arrayFlatten2 = _interopRequireDefault(_arrayFlatten); - -var _logger = require('./lib/logger'); - -var _logger2 = _interopRequireDefault(_logger); - -var _app = require('./app'); - -var _app2 = _interopRequireDefault(_app); - -var _defaultBindings = require('./defaultBindings'); - -var _defaultBindings2 = _interopRequireDefault(_defaultBindings); - -var _settings = require('./settings'); - -var _settings2 = _interopRequireDefault(_settings); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var NODE_PORT = process.env.NODE_PORT || 8080; - -process.on('uncaughtException', function (exception) { - _logger2.default.error('uncaughtException', { message: exception.message, stack: exception.stack }); // logging with MetaData - process.exit(1); // exit with failure -}); - -/* This is the container used app-wide for dependency injection. If you want to - * override any of the implementations, create your module with the new - * implementation and use: - * - * container.bindAlias(DefaultImplementation, MyNewImplementation); - * - * You can also set a new value - * container.bindAlias(DefaultValue, 12345); - * - * See https://github.com/justmoon/constitute for more info - */ -var container = new _constitute.Container(); -(0, _defaultBindings2.default)(container, _settings2.default); - -var deviceServer = container.constitute('DeviceServer'); -deviceServer.start(); - -var app = (0, _app2.default)(container, _settings2.default); - -app.listen(NODE_PORT, function () { - return console.log('express server started on port ' + NODE_PORT); -}); - -var addresses = (0, _arrayFlatten2.default)((0, _entries2.default)(_os2.default.networkInterfaces()).map( -// eslint-disable-next-line no-unused-vars -function (_ref) { - var _ref2 = (0, _slicedToArray3.default)(_ref, 2), - name = _ref2[0], - nic = _ref2[1]; - - return nic.filter(function (address) { - return address.family === 'IPv4' && address.address !== '127.0.0.1'; - }).map(function (address) { - return address.address; - }); -})); -addresses.forEach(function (address) { - return console.log('Your device server IP address is: ' + address); -}); \ No newline at end of file diff --git a/dist/managers/DeviceManager.js b/dist/managers/DeviceManager.js deleted file mode 100644 index 15a888ea..00000000 --- a/dist/managers/DeviceManager.js +++ /dev/null @@ -1,638 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _promise = require('babel-runtime/core-js/promise'); - -var _promise2 = _interopRequireDefault(_promise); - -var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); - -var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _extends2 = require('babel-runtime/helpers/extends'); - -var _extends3 = _interopRequireDefault(_extends2); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _ursa = require('ursa'); - -var _ursa2 = _interopRequireDefault(_ursa); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DeviceManager = function DeviceManager(deviceAttributeRepository, deviceFirmwareRepository, deviceKeyRepository, deviceServer) { - var _this = this; - - (0, _classCallCheck3.default)(this, DeviceManager); - - this.claimDevice = function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(deviceID, userID) { - var deviceAttributes, attributesToSave; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return _this._deviceAttributeRepository.getById(deviceID); - - case 2: - deviceAttributes = _context.sent; - - if (deviceAttributes) { - _context.next = 5; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 5: - if (!(deviceAttributes.ownerID && deviceAttributes.ownerID !== userID)) { - _context.next = 7; - break; - } - - throw new _HttpError2.default('The device belongs to someone else.'); - - case 7: - attributesToSave = (0, _extends3.default)({}, deviceAttributes, { - ownerID: userID - }); - _context.next = 10; - return _this._deviceAttributeRepository.update(attributesToSave); - - case 10: - return _context.abrupt('return', _context.sent); - - case 11: - case 'end': - return _context.stop(); - } - } - }, _callee, _this); - })); - - return function (_x, _x2) { - return _ref.apply(this, arguments); - }; - }(); - - this.unclaimDevice = function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(deviceID, userID) { - var deviceAttributes, attributesToSave; - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return _this._deviceAttributeRepository.getById(deviceID, userID); - - case 2: - deviceAttributes = _context2.sent; - - if (deviceAttributes) { - _context2.next = 5; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 5: - attributesToSave = (0, _extends3.default)({}, deviceAttributes, { - ownerID: null - }); - _context2.next = 8; - return _this._deviceAttributeRepository.update(attributesToSave); - - case 8: - return _context2.abrupt('return', _context2.sent); - - case 9: - case 'end': - return _context2.stop(); - } - } - }, _callee2, _this); - })); - - return function (_x3, _x4) { - return _ref2.apply(this, arguments); - }; - }(); - - this.getByID = function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(deviceID, userID) { - var attributes, device; - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return _this._deviceAttributeRepository.getById(deviceID, userID); - - case 2: - attributes = _context3.sent; - - if (attributes) { - _context3.next = 5; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 5: - device = _this._deviceServer.getDevice(attributes.deviceID); - return _context3.abrupt('return', (0, _extends3.default)({}, attributes, { - connected: device && device.ping().connected || false, - lastFlashedAppName: null, - lastHeard: device && device.ping().lastPing || attributes.lastHeard - })); - - case 7: - case 'end': - return _context3.stop(); - } - } - }, _callee3, _this); - })); - - return function (_x5, _x6) { - return _ref3.apply(this, arguments); - }; - }(); - - this.getDetailsByID = function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(deviceID, userID) { - var device, _ref5, _ref6, attributes, description; - - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - device = _this._deviceServer.getDevice(deviceID); - _context4.next = 3; - return _promise2.default.all([_this._deviceAttributeRepository.getById(deviceID, userID), device && device.getDescription()]); - - case 3: - _ref5 = _context4.sent; - _ref6 = (0, _slicedToArray3.default)(_ref5, 2); - attributes = _ref6[0]; - description = _ref6[1]; - - if (attributes) { - _context4.next = 9; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 9: - return _context4.abrupt('return', (0, _extends3.default)({}, attributes, { - connected: device && device.ping().connected || false, - functions: description ? description.state.f : null, - lastFlashedAppName: null, - lastHeard: device && device.ping().lastPing || attributes.lastHeard, - variables: description ? description.state.v : null - })); - - case 10: - case 'end': - return _context4.stop(); - } - } - }, _callee4, _this); - })); - - return function (_x7, _x8) { - return _ref4.apply(this, arguments); - }; - }(); - - this.getAll = function () { - var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(userID) { - var devicesAttributes, devicePromises; - return _regenerator2.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - _context6.next = 2; - return _this._deviceAttributeRepository.getAll(userID); - - case 2: - devicesAttributes = _context6.sent; - devicePromises = devicesAttributes.map(function () { - var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(attributes) { - var device; - return _regenerator2.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - device = _this._deviceServer.getDevice(attributes.deviceID); - return _context5.abrupt('return', (0, _extends3.default)({}, attributes, { - connected: device && device.ping().connected || false, - lastFlashedAppName: null, - lastHeard: device && device.ping().lastPing || attributes.lastHeard - })); - - case 2: - case 'end': - return _context5.stop(); - } - } - }, _callee5, _this); - })); - - return function (_x10) { - return _ref8.apply(this, arguments); - }; - }()); - return _context6.abrupt('return', _promise2.default.all(devicePromises)); - - case 5: - case 'end': - return _context6.stop(); - } - } - }, _callee6, _this); - })); - - return function (_x9) { - return _ref7.apply(this, arguments); - }; - }(); - - this.callFunction = function () { - var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(deviceID, userID, functionName, functionArguments) { - var doesUserHaveAccess, device; - return _regenerator2.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _context7.next = 2; - return _this._deviceAttributeRepository.doesUserHaveAccess(deviceID, userID); - - case 2: - doesUserHaveAccess = _context7.sent; - - if (doesUserHaveAccess) { - _context7.next = 5; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 5: - device = _this._deviceServer.getDevice(deviceID); - - if (device) { - _context7.next = 8; - break; - } - - throw new _HttpError2.default('Could not get device for ID', 404); - - case 8: - _context7.next = 10; - return device.callFunction(functionName, functionArguments); - - case 10: - return _context7.abrupt('return', _context7.sent); - - case 11: - case 'end': - return _context7.stop(); - } - } - }, _callee7, _this); - })); - - return function (_x11, _x12, _x13, _x14) { - return _ref9.apply(this, arguments); - }; - }(); - - this.getVariableValue = function () { - var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(deviceID, userID, varName) { - var doesUserHaveAccess, device; - return _regenerator2.default.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _context8.next = 2; - return _this._deviceAttributeRepository.doesUserHaveAccess(deviceID, userID); - - case 2: - doesUserHaveAccess = _context8.sent; - - if (doesUserHaveAccess) { - _context8.next = 5; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 5: - device = _this._deviceServer.getDevice(deviceID); - - if (device) { - _context8.next = 8; - break; - } - - throw new _HttpError2.default('Could not get device for ID', 404); - - case 8: - _context8.next = 10; - return device.getVariableValue(varName); - - case 10: - return _context8.abrupt('return', _context8.sent); - - case 11: - case 'end': - return _context8.stop(); - } - } - }, _callee8, _this); - })); - - return function (_x15, _x16, _x17) { - return _ref10.apply(this, arguments); - }; - }(); - - this.flashBinary = function () { - var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(deviceID, file) { - var device; - return _regenerator2.default.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - device = _this._deviceServer.getDevice(deviceID); - - if (device) { - _context9.next = 3; - break; - } - - throw new _HttpError2.default('Could not get device for ID', 404); - - case 3: - _context9.next = 5; - return device.flash(file.buffer); - - case 5: - return _context9.abrupt('return', _context9.sent); - - case 6: - case 'end': - return _context9.stop(); - } - } - }, _callee9, _this); - })); - - return function (_x18, _x19) { - return _ref11.apply(this, arguments); - }; - }(); - - this.flashKnownApp = function () { - var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(deviceID, userID, appName) { - var knownFirmware, device; - return _regenerator2.default.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - _context10.next = 2; - return !_this._deviceAttributeRepository.doesUserHaveAccess(deviceID, userID); - - case 2: - if (!_context10.sent) { - _context10.next = 4; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 4: - knownFirmware = _this._deviceFirmwareRepository.getByName(appName); - - if (knownFirmware) { - _context10.next = 7; - break; - } - - throw new _HttpError2.default('No firmware ' + appName + ' found', 404); - - case 7: - device = _this._deviceServer.getDevice(deviceID); - - if (device) { - _context10.next = 10; - break; - } - - throw new _HttpError2.default('Could not get device for ID', 404); - - case 10: - _context10.next = 12; - return device.flash(knownFirmware); - - case 12: - return _context10.abrupt('return', _context10.sent); - - case 13: - case 'end': - return _context10.stop(); - } - } - }, _callee10, _this); - })); - - return function (_x20, _x21, _x22) { - return _ref12.apply(this, arguments); - }; - }(); - - this.provision = function () { - var _ref13 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(deviceID, userID, publicKey) { - var createdKey, existingAttributes, attributes; - return _regenerator2.default.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - _context11.prev = 0; - createdKey = _ursa2.default.createPublicKey(publicKey); - - if (_ursa2.default.isPublicKey(createdKey)) { - _context11.next = 4; - break; - } - - throw new _HttpError2.default('Not a public key'); - - case 4: - _context11.next = 9; - break; - - case 6: - _context11.prev = 6; - _context11.t0 = _context11['catch'](0); - throw new _HttpError2.default('Key error ' + _context11.t0); - - case 9: - _context11.next = 11; - return _this._deviceKeyRepository.update(deviceID, publicKey); - - case 11: - _context11.next = 13; - return _this._deviceAttributeRepository.getById(deviceID); - - case 13: - existingAttributes = _context11.sent; - attributes = (0, _extends3.default)({ - deviceID: deviceID - }, existingAttributes, { - ownerID: userID, - registrar: userID, - timestamp: new Date() - }); - _context11.next = 17; - return _this._deviceAttributeRepository.update(attributes); - - case 17: - _context11.next = 19; - return _this.getByID(deviceID, userID); - - case 19: - return _context11.abrupt('return', _context11.sent); - - case 20: - case 'end': - return _context11.stop(); - } - } - }, _callee11, _this, [[0, 6]]); - })); - - return function (_x23, _x24, _x25) { - return _ref13.apply(this, arguments); - }; - }(); - - this.raiseYourHand = function () { - var _ref14 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(deviceID, userID, shouldShowSignal) { - var device; - return _regenerator2.default.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - _context12.next = 2; - return !_this._deviceAttributeRepository.doesUserHaveAccess(deviceID, userID); - - case 2: - if (!_context12.sent) { - _context12.next = 4; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 4: - device = _this._deviceServer.getDevice(deviceID); - - if (device) { - _context12.next = 7; - break; - } - - throw new _HttpError2.default('Could not get device for ID', 404); - - case 7: - _context12.next = 9; - return device.raiseYourHand(shouldShowSignal); - - case 9: - return _context12.abrupt('return', _context12.sent); - - case 10: - case 'end': - return _context12.stop(); - } - } - }, _callee12, _this); - })); - - return function (_x26, _x27, _x28) { - return _ref14.apply(this, arguments); - }; - }(); - - this.renameDevice = function () { - var _ref15 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(deviceID, userID, name) { - var attributes, attributesToSave; - return _regenerator2.default.wrap(function _callee13$(_context13) { - while (1) { - switch (_context13.prev = _context13.next) { - case 0: - _context13.next = 2; - return _this._deviceAttributeRepository.getById(deviceID, userID); - - case 2: - attributes = _context13.sent; - - if (attributes) { - _context13.next = 5; - break; - } - - throw new _HttpError2.default('No device found', 404); - - case 5: - attributesToSave = (0, _extends3.default)({}, attributes, { - name: name - }); - _context13.next = 8; - return _this._deviceAttributeRepository.update(attributesToSave); - - case 8: - return _context13.abrupt('return', _context13.sent); - - case 9: - case 'end': - return _context13.stop(); - } - } - }, _callee13, _this); - })); - - return function (_x29, _x30, _x31) { - return _ref15.apply(this, arguments); - }; - }(); - - this._deviceAttributeRepository = deviceAttributeRepository; - this._deviceFirmwareRepository = deviceFirmwareRepository; - this._deviceKeyRepository = deviceKeyRepository; - this._deviceServer = deviceServer; -}; - -exports.default = DeviceManager; \ No newline at end of file diff --git a/dist/managers/EventManager.js b/dist/managers/EventManager.js deleted file mode 100644 index 08436883..00000000 --- a/dist/managers/EventManager.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var EventManager = function EventManager(eventPublisher) { - var _this = this; - - (0, _classCallCheck3.default)(this, EventManager); - - this.subscribe = function (eventNamePrefix, eventHandler, filterOptions) { - return _this._eventPublisher.subscribe(eventNamePrefix, eventHandler, filterOptions); - }; - - this.unsubscribe = function (subscriptionID) { - return _this._eventPublisher.unsubscribe(subscriptionID); - }; - - this.publish = function (eventData) { - return _this._eventPublisher.publish(eventData); - }; - - this._eventPublisher = eventPublisher; -}; - -exports.default = EventManager; \ No newline at end of file diff --git a/dist/managers/FirmwareCompilationManager.js b/dist/managers/FirmwareCompilationManager.js deleted file mode 100644 index d124a01d..00000000 --- a/dist/managers/FirmwareCompilationManager.js +++ /dev/null @@ -1,260 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _stringify = require('babel-runtime/core-js/json/stringify'); - -var _stringify2 = _interopRequireDefault(_stringify); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _promise = require('babel-runtime/core-js/promise'); - -var _promise2 = _interopRequireDefault(_promise); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _map = require('babel-runtime/core-js/map'); - -var _map2 = _interopRequireDefault(_map); - -var _crypto = require('crypto'); - -var _crypto2 = _interopRequireDefault(_crypto); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _mkdirp = require('mkdirp'); - -var _mkdirp2 = _interopRequireDefault(_mkdirp); - -var _rmfr = require('rmfr'); - -var _rmfr2 = _interopRequireDefault(_rmfr); - -var _child_process = require('child_process'); - -var _sparkProtocol = require('spark-protocol'); - -var _settings = require('../settings'); - -var _settings2 = _interopRequireDefault(_settings); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var IS_COMPILATION_ENABLED = _fs2.default.existsSync(_settings2.default.FIRMWARE_REPOSITORY_DIRECTORY); - -var USER_APP_PATH = _path2.default.join(_settings2.default.FIRMWARE_REPOSITORY_DIRECTORY, 'user/applications'); -var BIN_PATH = _path2.default.join(_settings2.default.BUILD_DIRECTORY, 'bin'); -var MAKE_PATH = _path2.default.join(_settings2.default.FIRMWARE_REPOSITORY_DIRECTORY, 'main'); - -var FILE_NAME_BY_KEY = new _map2.default(); - -var getKey = function getKey() { - return _crypto2.default.randomBytes(24).toString('hex').substring(0, 24); -}; - -var getUniqueKey = function getUniqueKey() { - var key = getKey(); - while (FILE_NAME_BY_KEY.has(key)) { - key = getKey(); - } - return key; -}; - -var FirmwareCompilationManager = function FirmwareCompilationManager() { - (0, _classCallCheck3.default)(this, FirmwareCompilationManager); -}; - -FirmwareCompilationManager.firmwareDirectoryExists = function () { - return _fs2.default.existsSync(_settings2.default.FIRMWARE_REPOSITORY_DIRECTORY); -}; - -FirmwareCompilationManager.getBinaryForID = function (id) { - if (!FirmwareCompilationManager.firmwareDirectoryExists()) { - return null; - } - - var binaryPath = _path2.default.join(BIN_PATH, id); - if (!_fs2.default.existsSync(binaryPath)) { - return null; - } - - var binFileName = _fs2.default.readdirSync(binaryPath).find(function (file) { - return file.endsWith('.bin'); - }); - - if (!binFileName) { - return null; - } - - return _fs2.default.readFileSync(_path2.default.join(binaryPath, binFileName)); -}; - -FirmwareCompilationManager.compileSource = function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(platformID, files) { - var platformName, appFolder, appPath, id, binPath, makeProcess, errors, sizeInfo, date, config; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (FirmwareCompilationManager.firmwareDirectoryExists()) { - _context.next = 2; - break; - } - - return _context.abrupt('return', null); - - case 2: - platformName = _sparkProtocol.knownPlatforms[platformID]; - - if (platformName) { - _context.next = 5; - break; - } - - return _context.abrupt('return', null); - - case 5: - - platformName = platformName.toLowerCase(); - appFolder = (platformName + '_firmware_' + new Date().getTime()).toLowerCase(); - appPath = _path2.default.join(USER_APP_PATH, appFolder); - - _mkdirp2.default.sync(appPath); - - files.forEach(function (file) { - var fileName = file.originalname; - var fileExtension = _path2.default.extname(fileName); - var iterator = 0; - var combinedPath = _path2.default.join(appPath, fileName); - - while (_fs2.default.existsSync(combinedPath)) { - combinedPath = _path2.default.join(appPath, '' + _path2.default.basename(fileName, fileExtension) + ('_' + iterator++ + fileExtension)); - } - - _fs2.default.writeFileSync(combinedPath, file.buffer); - }); - - id = getUniqueKey(); - binPath = _path2.default.join(BIN_PATH, id); - makeProcess = (0, _child_process.spawn)('make', ['APP=' + appFolder, 'PLATFORM_ID=' + platformID, 'TARGET_DIR=' + _path2.default.relative(MAKE_PATH, binPath).replace(/\\/g, '/')], { cwd: MAKE_PATH }); - errors = []; - - makeProcess.stderr.on('data', function (data) { - console.log('' + data); - errors.push('' + data); - }); - - sizeInfo = 'not implemented'; - - makeProcess.stdout.on('data', function (data) { - var output = '' + data; - - if (output.includes('text\t')) { - sizeInfo = output; - } - }); - - _context.next = 19; - return new _promise2.default(function (resolve) { - makeProcess.on('exit', function () { - return resolve(); - }); - }); - - case 19: - date = new Date(); - - date.setDate(date.getDate() + 1); - config = { - binary_id: id, - errors: errors, - // expire in one day - expires_at: date, - - // TODO: this variable has a bunch of extra crap including file names. - // we should filter out the string to only show the file sizes - sizeInfo: sizeInfo - }; - - - FirmwareCompilationManager.addFirmwareCleanupTask(appPath, config); - - return _context.abrupt('return', config); - - case 24: - case 'end': - return _context.stop(); - } - } - }, _callee, undefined); - })); - - return function (_x, _x2) { - return _ref.apply(this, arguments); - }; -}(); - -FirmwareCompilationManager.addFirmwareCleanupTask = function (appFolderPath, config) { - var configPath = _path2.default.join(appFolderPath, 'config.json'); - if (!_fs2.default.existsSync(configPath)) { - _fs2.default.writeFileSync(configPath, (0, _stringify2.default)(config)); - } - var currentDate = new Date(); - var difference = new Date(config.expires_at).getTime() - currentDate.getTime(); - setTimeout(function () { - return (0, _rmfr2.default)(appFolderPath); - }, difference); -}; - -if (IS_COMPILATION_ENABLED) { - // Delete all expired binaries or queue them up to eventually be deleted. - if (!_fs2.default.existsSync(_settings2.default.BUILD_DIRECTORY)) { - _mkdirp2.default.sync(_settings2.default.BUILD_DIRECTORY); - } - if (!_fs2.default.existsSync(BIN_PATH)) { - _mkdirp2.default.sync(BIN_PATH); - } - - _fs2.default.readdirSync(USER_APP_PATH).forEach(function (file) { - var appFolder = _path2.default.join(USER_APP_PATH, file); - var configPath = _path2.default.join(appFolder, 'config.json'); - if (!_fs2.default.existsSync(configPath)) { - return; - } - - var configString = _fs2.default.readFileSync(configPath, 'utf8'); - if (!configString) { - return; - } - var config = JSON.parse(configString); - if (config.expires_at < new Date()) { - // TODO - clean up artifacts in the firmware folder. Every binary will have - // files in firmare/build/target/user & firmware/build/target/user-part - // It might make the most sense to just create a custom MAKE file to do this - (0, _rmfr2.default)(configPath); - (0, _rmfr2.default)(_path2.default.join(BIN_PATH, config.binary_id)); - } else { - FirmwareCompilationManager.addFirmwareCleanupTask(appFolder, config); - } - }); -} - -exports.default = FirmwareCompilationManager; \ No newline at end of file diff --git a/dist/managers/WebhookManager.js b/dist/managers/WebhookManager.js deleted file mode 100644 index d9e4bb9f..00000000 --- a/dist/managers/WebhookManager.js +++ /dev/null @@ -1,538 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = require('babel-runtime/helpers/extends'); - -var _extends3 = _interopRequireDefault(_extends2); - -var _promise = require('babel-runtime/core-js/promise'); - -var _promise2 = _interopRequireDefault(_promise); - -var _typeof2 = require('babel-runtime/helpers/typeof'); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _stringify = require('babel-runtime/core-js/json/stringify'); - -var _stringify2 = _interopRequireDefault(_stringify); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _map = require('babel-runtime/core-js/map'); - -var _map2 = _interopRequireDefault(_map); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _hogan = require('hogan.js'); - -var _hogan2 = _interopRequireDefault(_hogan); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -var _logger = require('../lib/logger'); - -var _logger2 = _interopRequireDefault(_logger); - -var _nullthrows = require('nullthrows'); - -var _nullthrows2 = _interopRequireDefault(_nullthrows); - -var _request = require('request'); - -var _request2 = _interopRequireDefault(_request); - -var _throttle = require('lodash/throttle'); - -var _throttle2 = _interopRequireDefault(_throttle); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var parseEventData = function parseEventData(event) { - try { - if (event.data) { - return JSON.parse(event.data); - } - return {}; - } catch (error) { - return {}; - } -}; - -var splitBufferIntoChunks = function splitBufferIntoChunks(buffer, chunkSize) { - var chunks = []; - var ii = 0; - while (ii < buffer.length) { - chunks.push(buffer.slice(ii, ii += chunkSize)); - } - - return chunks; -}; - -var validateRequestType = function validateRequestType(requestType) { - var upperRequestType = requestType.toUpperCase(); - if (!REQUEST_TYPES.includes(upperRequestType)) { - throw new _HttpError2.default('wrong requestType'); - } - - return upperRequestType; -}; - -var REQUEST_TYPES = ['DELETE', 'GET', 'POST', 'PUT']; -var MAX_WEBHOOK_ERRORS_COUNT = 10; -var WEBHOOK_THROTTLE_TIME = 1000 * 60; // 1min; -var MAX_RESPONSE_MESSAGE_CHUNK_SIZE = 512; -var MAX_RESPONSE_MESSAGE_SIZE = 100000; - -var WebhookManager = function WebhookManager(webhookRepository, eventPublisher) { - var _this = this; - - (0, _classCallCheck3.default)(this, WebhookManager); - this._subscriptionIDsByWebhookID = new _map2.default(); - this._errorsCountByWebhookID = new _map2.default(); - - this.create = function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(model) { - var webhook; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return _this._webhookRepository.create(model); - - case 2: - webhook = _context.sent; - - _this._subscribeWebhook(webhook); - return _context.abrupt('return', webhook); - - case 5: - case 'end': - return _context.stop(); - } - } - }, _callee, _this); - })); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }(); - - this.deleteByID = function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(webhookID, userID) { - var webhook; - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return _this._webhookRepository.getById(webhookID, userID); - - case 2: - webhook = _context2.sent; - - if (webhook) { - _context2.next = 5; - break; - } - - throw new _HttpError2.default('no webhook found', 404); - - case 5: - _context2.next = 7; - return _this._webhookRepository.deleteById(webhookID); - - case 7: - _this._unsubscribeWebhookByID(webhookID); - - case 8: - case 'end': - return _context2.stop(); - } - } - }, _callee2, _this); - })); - - return function (_x2, _x3) { - return _ref2.apply(this, arguments); - }; - }(); - - this.getAll = function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(userID) { - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return _this._webhookRepository.getAll(userID); - - case 2: - return _context3.abrupt('return', _context3.sent); - - case 3: - case 'end': - return _context3.stop(); - } - } - }, _callee3, _this); - })); - - return function (_x4) { - return _ref3.apply(this, arguments); - }; - }(); - - this.getByID = function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(webhookID, userID) { - var webhook; - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return _this._webhookRepository.getById(webhookID, userID); - - case 2: - webhook = _context4.sent; - - if (webhook) { - _context4.next = 5; - break; - } - - throw new _HttpError2.default('no webhook found', 404); - - case 5: - return _context4.abrupt('return', webhook); - - case 6: - case 'end': - return _context4.stop(); - } - } - }, _callee4, _this); - })); - - return function (_x5, _x6) { - return _ref4.apply(this, arguments); - }; - }(); - - this._init = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5() { - var allWebhooks; - return _regenerator2.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _context5.next = 2; - return _this._webhookRepository.getAll(); - - case 2: - allWebhooks = _context5.sent; - - allWebhooks.forEach(function (webhook) { - return _this._subscribeWebhook(webhook); - }); - - case 4: - case 'end': - return _context5.stop(); - } - } - }, _callee5, _this); - })); - - this._subscribeWebhook = function (webhook) { - var subscriptionID = _this._eventPublisher.subscribe(webhook.event, _this._onNewWebhookEvent(webhook), { - deviceID: webhook.deviceID, - mydevices: webhook.mydevices, - userID: webhook.ownerID - }); - _this._subscriptionIDsByWebhookID.set(webhook.id, subscriptionID); - }; - - this._unsubscribeWebhookByID = function (webhookID) { - var subscriptionID = _this._subscriptionIDsByWebhookID.get(webhookID); - if (!subscriptionID) { - return; - } - - _this._eventPublisher.unsubscribe(subscriptionID); - _this._subscriptionIDsByWebhookID.delete(webhookID); - }; - - this._onNewWebhookEvent = function (webhook) { - return function (event) { - try { - var webhookErrorCount = _this._errorsCountByWebhookID.get(webhook.id) || 0; - - if (webhookErrorCount < MAX_WEBHOOK_ERRORS_COUNT) { - _this.runWebhook(webhook, event); - return; - } - - _this._eventPublisher.publish({ - data: 'Too many errors, webhook disabled', - isPublic: false, - name: _this._compileErrorResponseTopic(webhook, event), - userID: event.userID - }); - - _this.runWebhookThrottled(webhook, event); - } catch (error) { - _logger2.default.error('webhookError: ' + error); - } - }; - }; - - this.runWebhook = function () { - var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(webhook, event) { - var _ret; - - return _regenerator2.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _context7.prev = 0; - return _context7.delegateYield(_regenerator2.default.mark(function _callee6() { - var webhookVariablesObject, requestAuth, requestJson, requestFormData, requestHeaders, requestUrl, requestQuery, responseTopic, requestType, isJsonRequest, requestOptions, responseBody, isResponseBodyAnObject, responseTemplate, responseEventData, chunks; - return _regenerator2.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - webhookVariablesObject = _this._getEventVariables(event); - requestAuth = _this._compileJsonTemplate(webhook.auth, webhookVariablesObject); - requestJson = _this._compileJsonTemplate(webhook.json, webhookVariablesObject); - requestFormData = _this._compileJsonTemplate(webhook.form, webhookVariablesObject); - requestHeaders = _this._compileJsonTemplate(webhook.headers, webhookVariablesObject); - requestUrl = _this._compileTemplate(webhook.url, webhookVariablesObject); - requestQuery = _this._compileJsonTemplate(webhook.query, webhookVariablesObject); - responseTopic = _this._compileTemplate(webhook.responseTopic, webhookVariablesObject); - requestType = _this._compileTemplate(webhook.requestType, webhookVariablesObject); - isJsonRequest = !!requestJson; - requestOptions = { - auth: requestAuth, - body: isJsonRequest ? _this._getRequestData(requestJson, event, webhook.noDefaults) : undefined, - form: !isJsonRequest ? _this._getRequestData(requestFormData, event, webhook.noDefaults) : undefined, - headers: requestHeaders, - json: true, - method: validateRequestType((0, _nullthrows2.default)(requestType)), - qs: requestQuery, - strictSSL: webhook.rejectUnauthorized, - url: (0, _nullthrows2.default)(requestUrl) - }; - _context6.next = 13; - return _this._callWebhook(webhook, event, requestOptions); - - case 13: - responseBody = _context6.sent; - - if (responseBody) { - _context6.next = 16; - break; - } - - return _context6.abrupt('return', { - v: void 0 - }); - - case 16: - isResponseBodyAnObject = responseBody === Object(responseBody); - responseTemplate = webhook.responseTemplate && isResponseBodyAnObject && _hogan2.default.compile(webhook.responseTemplate).render(responseBody); - responseEventData = responseTemplate || (isResponseBodyAnObject ? (0, _stringify2.default)(responseBody) : responseBody); - chunks = splitBufferIntoChunks(Buffer.from(responseEventData).slice(0, MAX_RESPONSE_MESSAGE_SIZE), MAX_RESPONSE_MESSAGE_CHUNK_SIZE); - - - chunks.forEach(function (chunk, index) { - var responseEventName = responseTopic && responseTopic + '/' + index || 'hook-response/' + event.name + '/' + index; - - _this._eventPublisher.publish({ - data: chunk, - isPublic: false, - name: responseEventName, - userID: event.userID - }); - }); - - case 21: - case 'end': - return _context6.stop(); - } - } - }, _callee6, _this); - })(), 't0', 2); - - case 2: - _ret = _context7.t0; - - if (!((typeof _ret === 'undefined' ? 'undefined' : (0, _typeof3.default)(_ret)) === "object")) { - _context7.next = 5; - break; - } - - return _context7.abrupt('return', _ret.v); - - case 5: - _context7.next = 10; - break; - - case 7: - _context7.prev = 7; - _context7.t1 = _context7['catch'](0); - - _logger2.default.error('webhookError: ' + _context7.t1); - - case 10: - case 'end': - return _context7.stop(); - } - } - }, _callee7, _this, [[0, 7]]); - })); - - return function (_x7, _x8) { - return _ref6.apply(this, arguments); - }; - }(); - - this.runWebhookThrottled = (0, _throttle2.default)(this.runWebhook, WEBHOOK_THROTTLE_TIME, { leading: false, trailing: true }); - - this._callWebhook = function (webhook, event, requestOptions) { - return new _promise2.default(function (resolve, reject) { - return (0, _request2.default)(requestOptions, function (error, response, responseBody) { - var onResponseError = function onResponseError(errorMessage) { - _this._incrementWebhookErrorCounter(webhook.id); - - _this._eventPublisher.publish({ - data: errorMessage, - isPublic: false, - name: _this._compileErrorResponseTopic(webhook, event), - userID: event.userID - }); - - reject(new Error(errorMessage)); - }; - - if (error) { - onResponseError(error.message); - return; - } - if (response.statusCode >= 400) { - onResponseError(response.statusMessage); - return; - } - - _this._resetWebhookErrorCounter(webhook.id); - - _this._eventPublisher.publish({ - isPublic: false, - name: 'hook-sent/' + event.name, - userID: event.userID - }); - - resolve(responseBody); - }); - }); - }; - - this._getEventVariables = function (event) { - var defaultWebhookVariables = { - PARTICLE_DEVICE_ID: event.deviceID, - PARTICLE_EVENT_NAME: event.name, - PARTICLE_EVENT_VALUE: event.data, - PARTICLE_PUBLISHED_AT: event.publishedAt, - // old event names, added for compatibility - SPARK_CORE_ID: event.deviceID, - SPARK_EVENT_NAME: event.name, - SPARK_EVENT_VALUE: event.data, - SPARK_PUBLISHED_AT: event.publishedAt - }; - - var eventDataVariables = parseEventData(event); - - return (0, _extends3.default)({}, defaultWebhookVariables, eventDataVariables); - }; - - this._getRequestData = function (customData, event, noDefaults) { - var defaultEventData = { - coreid: event.deviceID, - data: event.data, - event: event.name, - published_at: event.publishedAt - }; - - return noDefaults ? customData : (0, _extends3.default)({}, defaultEventData, customData || {}); - }; - - this._compileTemplate = function (template, variables) { - return template && _hogan2.default.compile(template).render(variables); - }; - - this._compileJsonTemplate = function (template, variables) { - if (!template) { - return undefined; - } - - var compiledTemplate = _this._compileTemplate((0, _stringify2.default)(template), variables); - if (!compiledTemplate) { - return undefined; - } - - return JSON.parse(compiledTemplate); - }; - - this._compileErrorResponseTopic = function (webhook, event) { - var variables = _this._getEventVariables(event); - return _this._compileTemplate(webhook.errorResponseTopic, variables) || 'hook-error/' + event.name; - }; - - this._incrementWebhookErrorCounter = function (webhookID) { - var errorsCount = _this._errorsCountByWebhookID.get(webhookID) || 0; - _this._errorsCountByWebhookID.set(webhookID, errorsCount + 1); - }; - - this._resetWebhookErrorCounter = function (webhookID) { - _this._errorsCountByWebhookID.set(webhookID, 0); - }; - - this._webhookRepository = webhookRepository; - this._eventPublisher = eventPublisher; - - (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8() { - return _regenerator2.default.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - _context8.next = 2; - return _this._init(); - - case 2: - return _context8.abrupt('return', _context8.sent); - - case 3: - case 'end': - return _context8.stop(); - } - } - }, _callee8, _this); - }))(); -}; - -exports.default = WebhookManager; \ No newline at end of file diff --git a/dist/repository/DeviceFirmwareFileRepository.js b/dist/repository/DeviceFirmwareFileRepository.js deleted file mode 100644 index 23239fda..00000000 --- a/dist/repository/DeviceFirmwareFileRepository.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _dec, _desc, _value, _class; - -var _sparkProtocol = require('spark-protocol'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var DeviceFirmwareFileRepository = (_dec = (0, _sparkProtocol.memoizeGet)([], { promise: false }), (_class = function () { - function DeviceFirmwareFileRepository(path) { - (0, _classCallCheck3.default)(this, DeviceFirmwareFileRepository); - - this._fileManager = new _sparkProtocol.FileManager(path, false); - } - - (0, _createClass3.default)(DeviceFirmwareFileRepository, [{ - key: 'getByName', - value: function getByName(appName) { - return this._fileManager.getFileBuffer(appName + '.bin'); - } - }]); - return DeviceFirmwareFileRepository; -}(), (_applyDecoratedDescriptor(_class.prototype, 'getByName', [_dec], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getByName'), _class.prototype)), _class)); -exports.default = DeviceFirmwareFileRepository; \ No newline at end of file diff --git a/dist/repository/UserFileRepository.js b/dist/repository/UserFileRepository.js deleted file mode 100644 index ff6f94a6..00000000 --- a/dist/repository/UserFileRepository.js +++ /dev/null @@ -1,524 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray'); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _extends2 = require('babel-runtime/helpers/extends'); - -var _extends3 = _interopRequireDefault(_extends2); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _desc, _value, _class; - -var _uuid = require('uuid'); - -var _uuid2 = _interopRequireDefault(_uuid); - -var _sparkProtocol = require('spark-protocol'); - -var _PasswordHasher = require('../lib/PasswordHasher'); - -var _PasswordHasher2 = _interopRequireDefault(_PasswordHasher); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var UserFileRepository = (_dec = (0, _sparkProtocol.memoizeSet)(), _dec2 = (0, _sparkProtocol.memoizeSet)(), _dec3 = (0, _sparkProtocol.memoizeGet)(), _dec4 = (0, _sparkProtocol.memoizeGet)(['id']), _dec5 = (0, _sparkProtocol.memoizeGet)(['username']), _dec6 = (0, _sparkProtocol.memoizeSet)(['id']), _dec7 = (0, _sparkProtocol.memoizeGet)(['username']), (_class = function () { - function UserFileRepository(path) { - var _this = this; - - (0, _classCallCheck3.default)(this, UserFileRepository); - - this.createWithCredentials = function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(userCredentials) { - var username, password, salt, passwordHash, modelToSave; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - username = userCredentials.username, password = userCredentials.password; - _context.next = 3; - return _PasswordHasher2.default.generateSalt(); - - case 3: - salt = _context.sent; - _context.next = 6; - return _PasswordHasher2.default.hash(password, salt); - - case 6: - passwordHash = _context.sent; - modelToSave = { - accessTokens: [], - passwordHash: passwordHash, - salt: salt, - username: username - }; - _context.next = 10; - return _this.create(modelToSave); - - case 10: - return _context.abrupt('return', _context.sent); - - case 11: - case 'end': - return _context.stop(); - } - } - }, _callee, _this); - })); - - return function (_x) { - return _ref.apply(this, arguments); - }; - }(); - - this.validateLogin = function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(username, password) { - var user, hash; - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.prev = 0; - _context2.next = 3; - return _this.getByUsername(username); - - case 3: - user = _context2.sent; - - if (user) { - _context2.next = 6; - break; - } - - throw new Error('User doesn\'t exist'); - - case 6: - _context2.next = 8; - return _PasswordHasher2.default.hash(password, user.salt); - - case 8: - hash = _context2.sent; - - if (!(hash !== user.passwordHash)) { - _context2.next = 11; - break; - } - - throw new Error('Wrong password'); - - case 11: - return _context2.abrupt('return', user); - - case 14: - _context2.prev = 14; - _context2.t0 = _context2['catch'](0); - throw _context2.t0; - - case 17: - case 'end': - return _context2.stop(); - } - } - }, _callee2, _this, [[0, 14]]); - })); - - return function (_x2, _x3) { - return _ref2.apply(this, arguments); - }; - }(); - - this.getByAccessToken = function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(accessToken) { - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return _this.getAll(); - - case 2: - _context3.t0 = function (user) { - return user.accessTokens.some(function (tokenObject) { - return tokenObject.accessToken === accessToken; - }); - }; - - return _context3.abrupt('return', _context3.sent.find(_context3.t0)); - - case 4: - case 'end': - return _context3.stop(); - } - } - }, _callee3, _this); - })); - - return function (_x4) { - return _ref3.apply(this, arguments); - }; - }(); - - this.deleteAccessToken = function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(userID, token) { - var user, userToSave; - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return _this.getById(userID); - - case 2: - user = _context4.sent; - - if (user) { - _context4.next = 5; - break; - } - - throw new Error('User doesn\'t exist'); - - case 5: - userToSave = (0, _extends3.default)({}, user, { - accessTokens: user.accessTokens.filter(function (tokenObject) { - return tokenObject.accessToken !== token; - }) - }); - _context4.next = 8; - return _this.update(userToSave); - - case 8: - case 'end': - return _context4.stop(); - } - } - }, _callee4, _this); - })); - - return function (_x5, _x6) { - return _ref4.apply(this, arguments); - }; - }(); - - this.saveAccessToken = function () { - var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(userID, tokenObject) { - var user, userToSave; - return _regenerator2.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _context5.next = 2; - return _this.getById(userID); - - case 2: - user = _context5.sent; - - if (user) { - _context5.next = 5; - break; - } - - throw new _HttpError2.default('Could not find user for user ID'); - - case 5: - userToSave = (0, _extends3.default)({}, user, { - accessTokens: [].concat((0, _toConsumableArray3.default)(user.accessTokens), [tokenObject]) - }); - _context5.next = 8; - return _this.update(userToSave); - - case 8: - return _context5.abrupt('return', _context5.sent); - - case 9: - case 'end': - return _context5.stop(); - } - } - }, _callee5, _this); - })); - - return function (_x7, _x8) { - return _ref5.apply(this, arguments); - }; - }(); - - this._fileManager = new _sparkProtocol.JSONFileManager(path); - } - - (0, _createClass3.default)(UserFileRepository, [{ - key: 'create', - value: function () { - var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(user) { - var id, modelToSave; - return _regenerator2.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - id = (0, _uuid2.default)(); - - case 1: - _context6.next = 3; - return this._fileManager.hasFile(id + '.json'); - - case 3: - if (!_context6.sent) { - _context6.next = 7; - break; - } - - id = (0, _uuid2.default)(); - _context6.next = 1; - break; - - case 7: - modelToSave = (0, _extends3.default)({}, user, { - created_at: new Date(), - created_by: null, - id: id - }); - - - this._fileManager.createFile(modelToSave.id + '.json', modelToSave); - return _context6.abrupt('return', modelToSave); - - case 10: - case 'end': - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function create(_x9) { - return _ref6.apply(this, arguments); - } - - return create; - }() - }, { - key: 'update', - value: function () { - var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(model) { - return _regenerator2.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - this._fileManager.writeFile(model.id + '.json', model); - return _context7.abrupt('return', model); - - case 2: - case 'end': - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function update(_x10) { - return _ref7.apply(this, arguments); - } - - return update; - }() - }, { - key: 'getAll', - value: function () { - var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8() { - return _regenerator2.default.wrap(function _callee8$(_context8) { - while (1) { - switch (_context8.prev = _context8.next) { - case 0: - return _context8.abrupt('return', this._fileManager.getAllData()); - - case 1: - case 'end': - return _context8.stop(); - } - } - }, _callee8, this); - })); - - function getAll() { - return _ref8.apply(this, arguments); - } - - return getAll; - }() - }, { - key: 'getById', - value: function () { - var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(id) { - return _regenerator2.default.wrap(function _callee9$(_context9) { - while (1) { - switch (_context9.prev = _context9.next) { - case 0: - return _context9.abrupt('return', this._fileManager.getFile(id + '.json')); - - case 1: - case 'end': - return _context9.stop(); - } - } - }, _callee9, this); - })); - - function getById(_x11) { - return _ref9.apply(this, arguments); - } - - return getById; - }() - }, { - key: 'getByUsername', - value: function () { - var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(username) { - return _regenerator2.default.wrap(function _callee10$(_context10) { - while (1) { - switch (_context10.prev = _context10.next) { - case 0: - _context10.next = 2; - return this.getAll(); - - case 2: - _context10.t0 = function (user) { - return user.username === username; - }; - - return _context10.abrupt('return', _context10.sent.find(_context10.t0)); - - case 4: - case 'end': - return _context10.stop(); - } - } - }, _callee10, this); - })); - - function getByUsername(_x12) { - return _ref10.apply(this, arguments); - } - - return getByUsername; - }() - - // This isn't a good one to memoize as we can't key off user ID and there - // isn't a good way to clear the cache. - - }, { - key: 'deleteById', - value: function () { - var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(id) { - return _regenerator2.default.wrap(function _callee11$(_context11) { - while (1) { - switch (_context11.prev = _context11.next) { - case 0: - this._fileManager.deleteFile(id + '.json'); - - case 1: - case 'end': - return _context11.stop(); - } - } - }, _callee11, this); - })); - - function deleteById(_x13) { - return _ref11.apply(this, arguments); - } - - return deleteById; - }() - }, { - key: 'isUserNameInUse', - value: function () { - var _ref12 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(username) { - return _regenerator2.default.wrap(function _callee12$(_context12) { - while (1) { - switch (_context12.prev = _context12.next) { - case 0: - _context12.next = 2; - return this.getAll(); - - case 2: - _context12.t0 = function (user) { - return user.username === username; - }; - - return _context12.abrupt('return', _context12.sent.some(_context12.t0)); - - case 4: - case 'end': - return _context12.stop(); - } - } - }, _callee12, this); - })); - - function isUserNameInUse(_x14) { - return _ref12.apply(this, arguments); - } - - return isUserNameInUse; - }() - }]); - return UserFileRepository; -}(), (_applyDecoratedDescriptor(_class.prototype, 'create', [_dec], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'create'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'update', [_dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'update'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getAll', [_dec3], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getAll'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getById', [_dec4], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getById'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getByUsername', [_dec5], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getByUsername'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'deleteById', [_dec6], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'deleteById'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'isUserNameInUse', [_dec7], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'isUserNameInUse'), _class.prototype)), _class)); -exports.default = UserFileRepository; \ No newline at end of file diff --git a/dist/repository/WebhookFileRepository.js b/dist/repository/WebhookFileRepository.js deleted file mode 100644 index c2a9da2c..00000000 --- a/dist/repository/WebhookFileRepository.js +++ /dev/null @@ -1,307 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); - -var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); - -var _extends2 = require('babel-runtime/helpers/extends'); - -var _extends3 = _interopRequireDefault(_extends2); - -var _regenerator = require('babel-runtime/regenerator'); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); - -var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); - -var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = require('babel-runtime/helpers/createClass'); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _dec, _dec2, _dec3, _dec4, _desc, _value, _class; - -var _uuid = require('uuid'); - -var _uuid2 = _interopRequireDefault(_uuid); - -var _sparkProtocol = require('spark-protocol'); - -var _HttpError = require('../lib/HttpError'); - -var _HttpError2 = _interopRequireDefault(_HttpError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } - - return desc; -} - -var WebhookFileRepository = (_dec = (0, _sparkProtocol.memoizeSet)(), _dec2 = (0, _sparkProtocol.memoizeSet)(['id']), _dec3 = (0, _sparkProtocol.memoizeGet)(), _dec4 = (0, _sparkProtocol.memoizeGet)(['id']), (_class = function () { - function WebhookFileRepository(path) { - var _this = this; - - (0, _classCallCheck3.default)(this, WebhookFileRepository); - - this.getAll = function () { - var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { - var userID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var allData; - return _regenerator2.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return _this._getAll(); - - case 2: - allData = _context.sent; - - if (!userID) { - _context.next = 5; - break; - } - - return _context.abrupt('return', allData.filter(function (webhook) { - return webhook.ownerID === userID; - })); - - case 5: - return _context.abrupt('return', allData); - - case 6: - case 'end': - return _context.stop(); - } - } - }, _callee, _this); - })); - - return function () { - return _ref.apply(this, arguments); - }; - }(); - - this.getById = function () { - var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(id) { - var userID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var webhook; - return _regenerator2.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return _this._getByID(id); - - case 2: - webhook = _context2.sent; - - if (!(!webhook || webhook.ownerID !== userID)) { - _context2.next = 5; - break; - } - - return _context2.abrupt('return', null); - - case 5: - return _context2.abrupt('return', webhook); - - case 6: - case 'end': - return _context2.stop(); - } - } - }, _callee2, _this); - })); - - return function (_x2) { - return _ref2.apply(this, arguments); - }; - }(); - - this.update = function () { - var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(model) { - return _regenerator2.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - throw new _HttpError2.default('Not implemented'); - - case 1: - case 'end': - return _context3.stop(); - } - } - }, _callee3, _this); - })); - - return function (_x4) { - return _ref3.apply(this, arguments); - }; - }(); - - this._fileManager = new _sparkProtocol.JSONFileManager(path); - } - - (0, _createClass3.default)(WebhookFileRepository, [{ - key: 'create', - value: function () { - var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(model) { - var id, modelToSave; - return _regenerator2.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - id = (0, _uuid2.default)(); - - case 1: - _context4.next = 3; - return this._fileManager.hasFile(id + '.json'); - - case 3: - if (!_context4.sent) { - _context4.next = 7; - break; - } - - id = (0, _uuid2.default)(); - _context4.next = 1; - break; - - case 7: - modelToSave = (0, _extends3.default)({}, model, { - created_at: new Date(), - id: id - }); - - - this._fileManager.createFile(modelToSave.id + '.json', modelToSave); - return _context4.abrupt('return', modelToSave); - - case 10: - case 'end': - return _context4.stop(); - } - } - }, _callee4, this); - })); - - function create(_x5) { - return _ref4.apply(this, arguments); - } - - return create; - }() - }, { - key: 'deleteById', - value: function () { - var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(id) { - return _regenerator2.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - this._fileManager.deleteFile(id + '.json'); - - case 1: - case 'end': - return _context5.stop(); - } - } - }, _callee5, this); - })); - - function deleteById(_x6) { - return _ref5.apply(this, arguments); - } - - return deleteById; - }() - - // eslint-disable-next-line no-unused-vars - - }, { - key: '_getAll', - value: function () { - var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6() { - return _regenerator2.default.wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - return _context6.abrupt('return', this._fileManager.getAllData()); - - case 1: - case 'end': - return _context6.stop(); - } - } - }, _callee6, this); - })); - - function _getAll() { - return _ref6.apply(this, arguments); - } - - return _getAll; - }() - }, { - key: '_getByID', - value: function () { - var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(id) { - return _regenerator2.default.wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - return _context7.abrupt('return', this._fileManager.getFile(id + '.json')); - - case 1: - case 'end': - return _context7.stop(); - } - } - }, _callee7, this); - })); - - function _getByID(_x7) { - return _ref7.apply(this, arguments); - } - - return _getByID; - }() - }]); - return WebhookFileRepository; -}(), (_applyDecoratedDescriptor(_class.prototype, 'create', [_dec], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'create'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'deleteById', [_dec2], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'deleteById'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_getAll', [_dec3], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, '_getAll'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_getByID', [_dec4], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, '_getByID'), _class.prototype)), _class)); -exports.default = WebhookFileRepository; \ No newline at end of file diff --git a/dist/settings.js b/dist/settings.js deleted file mode 100644 index fd63b211..00000000 --- a/dist/settings.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint-disable sorting/sort-object-props */ -exports.default = { - BUILD_DIRECTORY: _path2.default.join(__dirname, '../data/build'), - DEVICE_DIRECTORY: _path2.default.join(__dirname, '../data/deviceKeys'), - FIRMWARE_DIRECTORY: _path2.default.join(__dirname, '../data/knownApps'), - FIRMWARE_REPOSITORY_DIRECTORY: _path2.default.join(__dirname, '../../spark-firmware'), - SERVER_KEY_FILENAME: 'default_key.pem', - SERVER_KEYS_DIRECTORY: _path2.default.join(__dirname, '../data'), - USERS_DIRECTORY: _path2.default.join(__dirname, '../data/users'), - WEBHOOKS_DIRECTORY: _path2.default.join(__dirname, '../data/webhooks'), - - ACCESS_TOKEN_LIFETIME: 7776000, // 90 days, - API_TIMEOUT: 30000, // Timeout for API requests. - CRYPTO_SALT: 'aes-128-cbc', - LOG_REQUESTS: true, - LOGIN_ROUTE: '/oauth/token', - - PORT: 5683, - HOST: 'localhost' -}; /** - * Copyright (C) 2013-2014 Spark Labs, Inc. All rights reserved. - https://www.spark.io/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * You can download the source here: https://github.com/spark/spark-server - * - * - * - */ \ No newline at end of file diff --git a/dist/types.js b/dist/types.js deleted file mode 100644 index a726efc4..00000000 --- a/dist/types.js +++ /dev/null @@ -1 +0,0 @@ -'use strict'; \ No newline at end of file diff --git a/examples/DockerCompile/readme.md b/examples/DockerCompile/readme.md new file mode 100644 index 00000000..8cccef65 --- /dev/null +++ b/examples/DockerCompile/readme.md @@ -0,0 +1,43 @@ + + +# Using Docker to compile Firmware local (on any OS supporting Docker) + +Particle provides docker images including the complete toolchain. + +[https://hub.docker.com/r/particle/buildpack-particle-firmware/](https://hub.docker.com/r/particle/buildpack-particle-firmware/) + +to compile your source against a specific firmware version follow the following instructions + +## Preparations + +You need 2 directory "input" and "output". "input" will contain all your sources (the user directory), output will contain the firmware binaries. + +__Note__: You have to rename your *.ino file to application.cpp to make this work. + +Let's asume your directores are +``` +/runtime/sources +``` + +``` +/runtime/binaries +``` + +Choose your plattform and version from available tags [TAGS](https://hub.docker.com/r/particle/buildpack-particle-firmware/tags/). + +We will use +``` +0.6.2-photon +``` +for the latest stable firmware on photon + +## Execute + +So now compilation can be executed by running + +``` + docker run --rm -v /runtime/sources:/input -v /runtime/binaries:/output -e PLATFORM_ID=6 particle/buildpack-particle-firmware:0.6.2-photon +``` + +You will find 3 Files (Sytem part 1, System part 2 and your USERPART in output directory) + diff --git a/examples/Products.md b/examples/Products.md new file mode 100644 index 00000000..0e5cc040 --- /dev/null +++ b/examples/Products.md @@ -0,0 +1,453 @@ +# Products API + +The public cloud supports a products API through the admin console. Many of +these endpoints are undocumented and really require the UI to be user friendly. +In order to support different hardware/firmware versions, we have added a +subset of the products API which by default will create a single organization +that you can have multiple products under. We haven't implemented the +permissions system that comes with organizations so you can't rely on this to +handle account permissions. + +## Using the API +In order to user this API, you will need to call the endpoints using an admin +access token. We use this model because the admin account is the only account +which gets added to the organization. We currently haven't implemented any +organization endpoints which would allow you to add more users to the +organization. This adds a small amount of security in that you will only be +able to upload new firmware or edit products if you have the admin's access +token. + +In the future we may improve this flow and allow you to manage organizations, +but the main thing we are trying to handle here is product firmware versioning. +Since we haven't implemented a customers endpoint, it doesn't make much sense +to create new organizations. + +## Products Initial Setup +1. Grab the admin access token. This is logged to the console when the server +starts up. +2. Call the [Product Post Endpoint](#product-create) to create your first product. +3. Call the [Firmware Post Endpoint](#firmware-create) to add a new firmware. +You must set `current` to true in order to activate the firmware for your fleet. +4. Add some devices to your product with +[Product Device Post Endpoint](#product-devices-create) + +Once you've done this, your products should automatically update when you add +new versions of the firmware. **If the admin account is not the owner of the +device, it will be automatically quarantined. You will need to update the +[Product Device Put Endpoint](#product-devices-update) with +`{"quarantined": false}` if it's owned by another user.** + +## API + + ##### Product List + Example cURL: + ``` + curl -X GET \ + http://172.20.10.6:8080/v1/products/ \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' + ``` + Sample Response: + ``` + { + "products": [ + { + "description": "Test description", + "hardware_version": "v1.0.1", + "name": "Test Device 2", + "platform_id": 6, + "type": "Consumer", + "organization": "rIoYeEmVmEzPPzgT", + "slug": "test-device-2-v101", + "created_at": "2017-07-21T01:33:23.875Z", + "id": "7R04hBg30JAiDcVs", + "config_id": "wLqfYW6Hf9MCYWEH" + }, + { + "description": "Test description", + "hardware_version": "v1.0.0", + "name": "Test Device", + "platform_id": 6, + "type": "Consumer", + "organization": "rIoYeEmVmEzPPzgT", + "slug": "test-device-v100", + "created_at": "2017-07-21T01:33:02.555Z", + "id": "sYhdTrUyIzywIyl3", + "config_id": "qZ9AjcZbOtBDtAtA" + } + ] + } + ``` + ##### Product Get By ID or Slug + Example cURL: + ``` + curl -X GET \ + http://172.20.8.40:8080/v1/products/test-device-2-v101 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + }' + ``` + Sample Response: + ``` + { + "product": [ + { + "description": "Test description", + "hardware_version": "v1.0.1", + "name": "Test Device 2", + "platform_id": 6, + "type": "Consumer", + "organization": "rIoYeEmVmEzPPzgT", + "slug": "test-device-2-v101", + "created_at": "2017-07-21T01:33:23.875Z", + "id": "7R04hBg30JAiDcVs", + "config_id": "wLqfYW6Hf9MCYWEH" + } + ] + } + ``` + ##### Product Create + `Platform IDs`: + * 0 - Core + * 6 - Photon + * 8 - P1 + * 10 - Electron + * 103- Bluz + + `Product Type`: + * Consumer + * Hobbyist + * Industrial + + Example cURL: + ``` + curl -X POST \ + http://172.20.8.40:8080/v1/products \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + -d '{ + "product": { + "description": "Test description", + "hardware_version": "v1.0.0", + "name": "Test Device", + "platform_id": 6, + "type": "Consumer" + } + }' + ``` + Sample Response: + ``` + { + "product": [ + { + "description": "Test description", + "hardware_version": "v1.0.0", + "name": "Test Device", + "platform_id": 6, + "type": "Consumer", + "organization": "rIoYeEmVmEzPPzgT", + "slug": "test-device-v100", + "created_at": "2017-07-20T20:48:43.442Z", + "id": 1, + "config_id": "IxjRmTWEH1nsxxOz" + } + ] + } + ``` + ##### Product Update + Example cURL: + ``` + curl -X PUT \ + http://172.20.8.40:8080/v1/products/test-device-2-v101 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + -d '{ + "product": { + "description": "Test description", + "hardware_version": "v1.0.1", + "name": "Test Device 2", + "platform_id": 6, + "type": "Consumer", + "organization": "rIoYeEmVmEzPPzgT", + "slug": "test-device-2-v101", + "created_at": "2017-07-21T01:33:23.875Z", + "id": 1, + "config_id": "wLqfYW6Hf9MCYWEH" + } + }' + ``` + Sample Response: + ``` + { + "product": [ + { + "description": "Test description", + "hardware_version": "v1.0.1", + "name": "Test Device 2", + "platform_id": 6, + "type": "Consumer", + "organization": "rIoYeEmVmEzPPzgT", + "slug": "test-device-2-v101", + "created_at": "2017-07-21T01:33:23.875Z", + "id": 1, + "config_id": "wLqfYW6Hf9MCYWEH" + } + ] + } + ``` + ##### Product Delete + Example cURL: + ``` + curl -X DELETE \ + http://172.20.8.40:8080/v1/products/test-device-2-v101 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + ``` + ##### Product Config Get + Example cURL: + ``` + curl -X GET \ + http://172.20.8.40:8080/v1/products/test-device-v100/config \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + -H 'postman-token: 325462d2-a6e3-4b6c-d7b7-cf0c7fe255ff' + ``` + Sample Response: + ``` + { + "product_configuration": { + "org_id": "rIoYeEmVmEzPPzgT", + "product_id": "sYhdTrUyIzywIyl3", + "id": "qZ9AjcZbOtBDtAtA" + } + } + ``` + ##### Firmware List + Example cURL: + ``` + curl -X GET \ + http://172.20.8.40:8080/v1/products/test-device-v100/firmware/ \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + ``` + Sample Response: + ``` + [ + { + "current": "false", + "description": "Test Description\n", + "device_count": 0, + "name": "photon_0.5.3_firmware_1500742294177.bin", + "product_id": "1", + "size": 36088, + "title": "Test Title", + "version": "2", + "updated_at": "2017-07-22T16:55:48.705Z", + "id": "SJVuRZQxBGyembNH" + } + ] + ``` + ##### Firmware Get + Example cURL: + ``` + curl -X GET \ + http://172.20.8.40:8080/v1/products/test-device-v100/firmware/2 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + ``` + Sample Response: + ``` + { + "current": "false", + "description": "Test Description\n", + "device_count": 0, + "name": "photon_0.5.3_firmware_1500742294177.bin", + "product_id": "1", + "size": 36088, + "title": "Test Title", + "version": "2", + "updated_at": "2017-07-22T16:55:48.705Z" + } + ``` + ##### Firmware Create + Example cURL: + ``` + curl -X POST \ + http://172.20.8.40:8080/v1/products/test-device-v100/firmware \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \ + -F version=2 \ + -F current=false \ + -F 'binary=@C:\photon_tinker.bin' \ + -F 'title=Test Title' \ + -F 'description=Test Description + ' + ``` + Sample Response: + ``` + { + "current": "false", + "description": "Test Description\n", + "device_count": 0, + "name": "photon_tinker.bin", + "product_id": 1, + "size": 3952, + "title": "Test Title", + "updated_at": "2017-07-22T14:48:27.120Z", + "version": "2", + } + ``` + ##### Firmware Update + Example cURL: + ``` + curl -X PUT \ + http://172.20.8.40:8080/v1/products/test-device-v100/firmware/2 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + -d '{ + "current": "true", + "description": "Test Description asdfasdfasdfas\n", + "title": "Test Title" + }' + ``` + Sample Response: + ``` + { + "current": "true", + "description": "Test Description asdfasdfasdfas\n", + "device_count": 0, + "name": "photon_0.5.3_firmware_1500742294177.bin", + "product_id": "1", + "size": 36088, + "title": "Test Title", + "version": "2", + "updated_at": "2017-07-22T17:14:43.978Z" + } + ``` + ##### Firmware Delete + Example cURL: + ``` + curl -X DELETE \ + http://172.20.8.40:8080/v1/products/test-device-v100/firmware/2 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' + ``` + ##### Product Devices List + Pass `per_page` and `page` to paginate. Pages start at `1` instead of zero. + + Example cURL + ``` + curl -X GET \ + http://192.168.1.19:8080/v1/products/test-device-v100/devices \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' + ``` + Sample Response: + ``` + { + "accounts": [], + "devices": [ + { + "deviceID": "2c0040000547343337373737", + "ownerID": "d5C5YtUw0OO9f4mw", + "registrar": "d5C5YtUw0OO9f4mw", + "timestamp": "2017-07-24T01:24:07.083Z", + "timeStamp": "2017-07-24T01:24:07.083Z", + "particleProductId": 6, + "id": "H4a4pe8dZIaTG829", + "denied": false, + "development": false, + "quarantined": false + } + ], + "meta": { + "total_pages": 1 + } + } + ``` + ##### Product Device Get + Example cURL + ``` + curl -X GET \ + http://192.168.1.19:8080/v1/products/test-device-v100/devices/2c0040000547343337373737 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' + ``` + Sample Response: + ``` + { + "deviceID": "2c0040000547343337373737", + "ownerID": "d5C5YtUw0OO9f4mw", + "registrar": "d5C5YtUw0OO9f4mw", + "timestamp": "2017-07-24T01:24:07.083Z", + "particleProductId": 6, + "id": "H4a4pe8dZIaTG829", + "denied": false, + "development": false, + "quarantined": false + } + ``` + ##### Product Devices Create + This endpoint can be used in two ways. You can either pass `one` as the + `import_method` and send an `id`. If you have a CSV, you can pass `many` and + send the file (with a field name of `file`). The format of the file should + be a single column of device IDs. + + Example cURL + ``` + curl -X POST \ + http://192.168.1.19:8080/v1/products/test-device-v100/devices \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + -d '{"id": "27002d001547343339383037", "import_method": "one"}' + ``` + Sample Response: + ``` + { + "updated": 1, + "nonmemberDeviceIds": [], + "invalidDeviceIds": [] + } + ``` + ##### Product Devices Update + You can update `desired_firmware_version`, `notes`, `quarantined`, + `denied`, and `development`. + Example cURL + ``` + curl -X PUT \ + http://192.168.1.19:8080/v1/products/test-device-v100/devices/2c0040000547343337373737 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' \ + -d '{"desired_firmware_version": 2}' + ``` + Sample Response: + ``` + { + "id": "41CvO5SGrd6UUDlO", + "updated_at": "2017-07-24T02:23:05.735Z", + "parsedFirmware": 2 + } + ``` + ##### Product Devices Delete + Example cURL + ``` + curl -X DELETE \ + http://192.168.1.19:8080/v1/products/test-device-v100/devices/2c0040000547343337373737 \ + -H 'authorization: Bearer d2fafe627086dc56472aa0d8cc13ae9c20293371' \ + -H 'cache-control: no-cache' \ + -H 'content-type: application/json' + ``` diff --git a/examples/azure-mongodb/main.js b/examples/azure-mongodb/main.js new file mode 100644 index 00000000..6148649f --- /dev/null +++ b/examples/azure-mongodb/main.js @@ -0,0 +1,113 @@ +/* + * In this example we are using Azure storage for our SSL keys + + * MongoDB (Azure Cosmos DB) + * + * If you are using Cosmos and aren't replicating your data, be + * sure to remove the `replicaSet=globaldb` from your connection + * string. + */ + +/* eslint-disable */ + +import arrayFlatten from 'array-flatten'; +import azure from 'azure-storage'; +import { Container } from 'constitute'; +import express from 'express'; +import http from 'http'; +import https from 'https'; +import os from 'os'; +import path from 'path'; +import settings from './settings'; +import { MongoDb, createApp, defaultBindings, logger } from 'spark-server'; + +const NODE_PORT = process.env.NODE_PORT || settings.EXPRESS_SERVER_CONFIG.PORT; +const useHttp = NODE_PORT !== 443; + +process.on('uncaughtException', (exception: Error) => { + logger.error('uncaughtException', { + message: exception.message, + stack: exception.stack, + }); // logging with MetaData + process.exit(1); // exit with failure +}); + +const container = new Container(); +defaultBindings(container, settings); + +// you have to override database bindings to use MongoDB instead of neDB: +container.bindValue('DATABASE_URL', settings.DB_CONFIG.URL); +container.bindValue('DATABASE_OPTIONS', settings.DB_CONFIG.OPTIONS); +container.bindClass('IDatabase', MongoDb, ['DATABASE_URL', 'DATABASE_OPTIONS']); + +function promisify( + call: (serviceCallback: (error: StorageError, result: T) => void) => void, +): Promise { + return new Promise((resolve, reject) => { + try { + call((error, result) => { + if (error) { + reject(error); + return; + } + resolve(result); + }); + } catch (err) { + reject(err); + } + }); +} + +const blobService = azure.createBlobService( + settings.AZURE_STORAGE_CONNECTION_KEY, +); + +(async () => { + try { + const sslCertificate = await promisify(cb => + blobService.getBlobToText('keys', settings.SSL_CERTIFICATE, cb), + ); + const privateKey = await promisify(cb => + blobService.getBlobToText('keys', settings.SSL_PRIVATE_KEY, cb), + ); + + const options = { + cert: sslCertificate, + key: privateKey, + // This is necessary only if using the client certificate authentication. + requestCert: true, + }; + + const deviceServer = container.constitute('DeviceServer'); + deviceServer.start(); + + const app = express(); + createApp(container, settings, app); + + (useHttp + ? http.createServer(app) + : https.createServer(options, app) + ).listen( + NODE_PORT, + (): void => console.log(`express server started on port ${NODE_PORT}`), + ); + + const addresses = arrayFlatten( + Object.entries(os.networkInterfaces()).map( + // eslint-disable-next-line no-unused-vars + ([name, nic]: [string, mixed]): Array => + (nic: any) + .filter( + (address: Object): boolean => + address.family === 'IPv4' && address.address !== '127.0.0.1', + ) + .map((address: Object): boolean => address.address), + ), + ); + addresses.forEach( + (address: string): void => + console.log(`Your device server IP address is: ${address}`), + ); + } catch (error) { + console.log('SSL ERROR', error); + } +})(); diff --git a/examples/azure-mongodb/settings.ts b/examples/azure-mongodb/settings.ts new file mode 100644 index 00000000..0ea53cee --- /dev/null +++ b/examples/azure-mongodb/settings.ts @@ -0,0 +1,84 @@ +import path from 'path'; + +type ConfigType = { + BUILD_DIRECTORY: string, + DEFAULT_ADMIN_PASSWORD: string, + DEFAULT_ADMIN_USERNAME: string, + DEVICE_DIRECTORY: string, + ENABLE_SYSTEM_FIRWMARE_AUTOUPDATES: boolean, + FIRMWARE_DIRECTORY: string, + FIRMWARE_REPOSITORY_DIRECTORY: string, + SERVER_KEY_FILENAME: string, + SERVER_KEYS_DIRECTORY: string, + USERS_DIRECTORY: string, + WEBHOOKS_DIRECTORY: string, + ACCESS_TOKEN_LIFETIME: number, + API_TIMEOUT: number, + CRYPTO_ALGORITHM: string, + LOG_REQUESTS: boolean, + LOGIN_ROUTE: string, + EXPRESS_SERVER_CONFIG: { + PORT: number, + SSL_CERTIFICATE_FILEPATH: string | null, + SSL_PRIVATE_KEY_FILEPATH: string | null, + USE_SSL: boolean + }, + DB_CONFIG: { + OPTIONS: any, + URL: string + }, + SHOW_VERBOSE_DEVICE_LOGS: boolean, + TCP_DEVICE_SERVER_CONFIG: { + HOST: string, + PORT: number + }, + WEBHOOK_TEMPLATE_PARAMETERS: any +}; + +const CONFIG: ConfigType = { + BUILD_DIRECTORY: path.join(__dirname, '../data/build'), + DEFAULT_ADMIN_PASSWORD: 'adminPassword', + DEFAULT_ADMIN_USERNAME: '__admin__', + DEVICE_DIRECTORY: path.join(__dirname, '../data/deviceKeys'), + ENABLE_SYSTEM_FIRWMARE_AUTOUPDATES: true, + FIRMWARE_DIRECTORY: path.join(__dirname, '../data/knownApps'), + FIRMWARE_REPOSITORY_DIRECTORY: path.join(__dirname, '../../spark-firmware'), + SERVER_KEY_FILENAME: 'default_key.pem', + SERVER_KEYS_DIRECTORY: path.join(__dirname, '../data'), + USERS_DIRECTORY: path.join(__dirname, '../data/users'), + WEBHOOKS_DIRECTORY: path.join(__dirname, '../data/webhooks'), + ACCESS_TOKEN_LIFETIME: 7776000, // 90 days, + API_TIMEOUT: 30000, // Timeout for API requests. + CRYPTO_ALGORITHM: 'aes-128-cbc', + LOG_REQUESTS: true, + LOGIN_ROUTE: '/oauth/token', + EXPRESS_SERVER_CONFIG: { + PORT: 8080, + SSL_CERTIFICATE_FILEPATH: null, + SSL_PRIVATE_KEY_FILEPATH: null, + USE_SSL: false, + }, + DB_CONFIG: { + OPTIONS: { + // here you can pass any options, which MongoClient.connect() accepts + // retry to connect for 60 times + reconnectTries: 60, + // wait 1 second before retrying + reconnectInterval: 1000, + }, + // you have to provide mongo connection URL here + URL: 'mongodb://host:impFJimWwvAJ59u8E...', + }, + SHOW_VERBOSE_DEVICE_LOGS: false, + + TCP_DEVICE_SERVER_CONFIG: { + HOST: 'localhost', + PORT: 5683, + }, + // Override template parameters in webhooks with this object + WEBHOOK_TEMPLATE_PARAMETERS: { + // SOME_AUTH_TOKEN: '12312312', + }, +}; + +export default CONFIG; diff --git a/examples/docker/production/Dockerfile b/examples/docker/production/Dockerfile new file mode 100644 index 00000000..f2083c03 --- /dev/null +++ b/examples/docker/production/Dockerfile @@ -0,0 +1,48 @@ + +# +# Local Cloud Sparc-Server +# + +# +# based on Alpine Node (version 8 is tested, other Version should work as well) +# +FROM mhart/alpine-node:7 + + +# create the Working Directory +RUN mkdir -p /usr/src/localCloud + +# install all dependencies and delete them in ONE single RUN +# you can split this into different steps, but this will make the Image MUCH larger! +RUN apk add --no-cache git; \ + cd /usr/src/localCloud; \ + git clone https://github.com/Brewskey/spark-server.git; \ + cd /usr/src/localCloud/spark-server; \ + git checkout c182732cad6075354846f6034076fe987d599994; \ + rm -rf .git; \ + npm install; \ + apk del git; \ + npm run prebuild; \ + npm run build + + + +# Set Working Directory +WORKDIR /usr/src/localCloud/spark-server + + +# Expose SparkPort to be mapped +EXPOSE 5683 + +# Expose ServerPort for API +EXPOSE 8080 + +# Expose DataDirectory to store DB and Device Keys +VOLUME /usr/src/localCloud/spark-server/data + + + +ENTRYPOINT ["npm", "run", "start:prod"] + + + diff --git a/examples/docker/readme.md b/examples/docker/readme.md new file mode 100644 index 00000000..2fc4df73 --- /dev/null +++ b/examples/docker/readme.md @@ -0,0 +1,99 @@ + +# Run Spark Server from Docker HUB + +If you have installed Docker you can start a ParticleServer directly from CommandLine. + +[https://hub.docker.com/r/keatec/spark-server/](https://hub.docker.com/r/keatec/spark-server/) + +Follow link for more informations ! + + +# Build a Spark-Server as a Docker Image + +## 1. Install Docker + +[https://www.docker.com/]() + +## 2. Compile Image + +> This has to be done only once or if you want to create a uptodate Version from the Repository + +* navigate to the folder production +* Start Building (note: there is a final . at end of line!) +```shell +docker build -t spark-server:latest . +``` + > **Note about Version Tag (spark-server:latest) !** + Docker uses Tags and Version semantics to specify a Version of an image. + Right now there is not a version of the **spark-server** to be used here. +So it is up to you to define a Version for different compilations ! +I will use **latest** as a version tag here! + + > + +The Dockerengine will now build a Image. Contents of the Image +* Alpine Node (a very small node version) +* Fresh Spark-Server version (using git clone https://github.com/Brewskey/spark-server.git \) +* Dependencies (like node-gyp, gcc compiler etc.) + +if you run +```shell + docker images +``` +you should see a line like +```shell +spark-server latest e72ee8de918f ... ago 208.3 MB +``` + +> Yep, the image is only 210 Mb. +Thats all you need to run a spark-server + +## 3. Use the Image + +The Image will expose the following EndPoints +* PORT **5683** (COAP Port) +* PORT **8080** (API Port) +* DIRECTORY **/usr/src/localCloud/spark-server/data** + +If you want to start the image, you need a place to store all your runtime data (database files, keyfiles etc.) + +> Since Docker images are NOT VMWARE Machines, Docker Instances are completly stateless. So you have to bind directories to your Enviroment so the image can store persistent data + +Create a directory for your production (lets asume you are in **/runtime**) +```shell + mkdir spark-server +``` + +navigate to this directory +```shell + cd spark-server +``` + +Create a data-directory so the instance can store all runtime files in this directory +```shell + mkdir data +``` + +Your working directory is now **/runtime/spark-server** + +To start the Server + +```shell +docker run -p 8100:8080 -p 5683:5683 --volume /runtime/spark-server/data:/usr/src/localCloud/spark-server/data --rm --name spark-server --hostname spark-server spark-server:latest +``` + +Just a short explanation what's happening + +* **-p 8100:8080** API Port will be available on port 8100 on HostMachine +* **-p 5683:5683** Sparc Port is mapped to the same port on HostMachine +* **--volume /runtime/spark-server/data:/usr/src/localCloud/spark-server/data** +your data directory created early is mapped to the data directory insinde the instance +* **--rm** Instance is removed after finished +* **--name spark-server** you can access or reference this instance using **spark-server** +this also ensures only one instance with this name can run at the same time! +* **--hostname spark-server** any other running **Docker Instance** can access the Server using the hostname **spark-server** +* **spark-server:latest** use the image tagged with **latest** for this instance + +## Thats all! + +If the Server is running you should see runtime file inside the data directory. These are also the Files to Backup your existing Spark-Server diff --git a/examples/eventProvider.js b/examples/eventProvider.js new file mode 100644 index 00000000..5ff557ba --- /dev/null +++ b/examples/eventProvider.js @@ -0,0 +1,40 @@ +/* + * Many of you want to scale the server with docker images or some other way. + * You should be able to use the following code to get full events stream + * and pipe it with some service like rabbitMQ or zeroMQ. + * You shouldn't worry about events mirroring between different processes, + * EVENT_PROVIDER is smart enough to filter broadcasted events. + */ + +/* + to build this sample run + + npm run examples:build + + to run + + npm run examples:run:eventprovider + + if this fails, ensure you have to latest version of spark-protocol, run + + npm update spark-protocol + +*/ + +/* eslint-disable */ + +import { Container } from 'constitute'; +import defaultBindings from '../defaultBindings'; +import settings from '../settings.js'; +import logger from '../lib/logger'; + +const container = new Container(); +defaultBindings(container, settings); + +const deviceServer = container.constitute('DeviceServer'); +deviceServer.start(); + +const eventProvider = container.constitute('EVENT_PROVIDER'); +eventProvider.onNewEvent((event) => { + logger.info('Event onNewEvent', event); +}); diff --git a/flow-typed/npm/express_v4.x.x.js b/flow-typed/npm/express_v4.x.x.js deleted file mode 100644 index 29b7cf1b..00000000 --- a/flow-typed/npm/express_v4.x.x.js +++ /dev/null @@ -1,199 +0,0 @@ -// flow-typed signature: 54f4a1579bf43031e95db3d78777be00 -// flow-typed version: aac2114da6/express_v4.x.x/flow_>=v0.25.x - -// @flow -import type { Server } from 'http'; - -declare type express$RouterOptions = { - caseSensitive?: boolean, - mergeParams?: boolean, - strict?: boolean -}; - -declare class express$RequestResponseBase { - app: express$Application; - get(field: string): string | void; -} - -declare type $File = { - buffer: Buffer, - destination: string, - encoding: string, - fieldname: string, - filename: string, - mimetype: string, - originalname: string, - path: string, - size: number, -}; - -declare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase { - baseUrl: string; - body: Object; - cookies: {[cookie: string]: string}; - files: { [key: string]: Array<$File> } | Array<$File>, - fresh: boolean; - hostname: boolean; - ip: string; - ips: Array; - method: string; - originalUrl: string; - params: {[param: string]: string}; - path: string; - protocol: 'https' | 'http'; - query: {[name: string]: string}; - route: string; - secure: boolean; - signedCookies: {[signedCookie: string]: string}; - stale: boolean; - subdomains: Array; - xhr: boolean; - accepts(types: string): string | false; - acceptsCharsets(...charsets: Array): string | false; - acceptsEncodings(...encoding: Array): string | false; - acceptsLanguages(...lang: Array): string | false; - header(field: string): string | void; - is(type: string): boolean; - param(name: string, defaultValue?: string): string | void; -} - -declare type express$CookieOptions = { - domain?: string, - encode?: (value: string) => string, - expires?: Date, - httpOnly?: boolean, - maxAge?: string, - path?: string, - secure?: boolean, - signed?: boolean -}; - -declare type express$RenderCallback = (err: Error | null, html?: string) => mixed; - -declare type express$SendFileOptions = { - maxAge?: number, - root?: string, - lastModified?: boolean, - headers?: {[name: string]: string}, - dotfiles?: 'allow' | 'deny' | 'ignore' -}; - -declare class express$Response extends http$ServerResponse mixins express$RequestResponseBase { - headersSent: boolean; - locals: {[name: string]: mixed}; - append(field: string, value?: string): this; - attachment(filename?: string): this; - cookie(name: string, value: string, options?: express$CookieOptions): this; - clearCookie(name: string, options?: express$CookieOptions): this; - download(path: string, filename?: string, callback?: (err?: ?Error) => void): this; - format(typesObject: {[type: string]: Function}): this; - json(body?: mixed): this; - jsonp(body?: mixed): this; - links(links: {[name: string]: string}): this; - location(path: string): this; - redirect(url: string, ...args: Array): this; - redirect(status: number, url: string, ...args: Array): this; - render(view: string, locals?: {[name: string]: mixed}, callback?: express$RenderCallback): this; - send(body?: mixed): this; - sendFile(path: string, options?: express$SendFileOptions, callback?: (err?: ?Error) => mixed): this; - sendStatus(statusCode: number): this; - set(field: string | {[field: string]: ?string}, value?: string): this; - status(statusCode: number): this; - type(type: string): this; - vary(field: string): this; -} - -declare type express$NextFunction = (err?: ?Error) => mixed; -declare type express$Middleware = - (req: express$Request, res: express$Response, next: express$NextFunction) => mixed; -declare interface express$RouteMethodType { - (middleware: express$Middleware): T; - (...middleware: Array): T; - (path: string|RegExp|string[], ...middleware: Array): T; -} -declare interface express$RouterMethodType { - (middleware: express$Middleware): T; - (...middleware: Array): T; - (path: string|RegExp|string[], ...middleware: Array): T; - (path: string, router: express$Router): T; -} -declare class express$Route { - all: express$RouteMethodType; - get: express$RouteMethodType; - post: express$RouteMethodType; - put: express$RouteMethodType; - head: express$RouteMethodType; - delete: express$RouteMethodType; - options: express$RouteMethodType; - trace: express$RouteMethodType; - copy: express$RouteMethodType; - lock: express$RouteMethodType; - mkcol: express$RouteMethodType; - move: express$RouteMethodType; - purge: express$RouteMethodType; - propfind: express$RouteMethodType; - proppatch: express$RouteMethodType; - unlock: express$RouteMethodType; - report: express$RouteMethodType; - mkactivity: express$RouteMethodType; - checkout: express$RouteMethodType; - merge: express$RouteMethodType; - - // @TODO Missing 'm-search' but get flow illegal name error. - - notify: express$RouteMethodType; - subscribe: express$RouteMethodType; - unsubscribe: express$RouteMethodType; - patch: express$RouteMethodType; - search: express$RouteMethodType; - connect: express$RouteMethodType; -} - -declare class express$Router extends express$Route { - constructor(options?: express$RouterOptions): void; - use: express$RouterMethodType; - route(path: string): express$Route; - static (): express$Router; -} - -declare class express$Application extends express$Router mixins events$EventEmitter { - constructor(): void; - locals: {[name: string]: mixed}; - mountpath: string; - listen(port: number, hostname?: string, backlog?: number, callback?: (err?: ?Error) => mixed): Server; - listen(port: number, hostname?: string, callback?: (err?: ?Error) => mixed): Server; - listen(port: number, callback?: (err?: ?Error) => mixed): Server; - listen(path: string, callback?: (err?: ?Error) => mixed): Server; - listen(handle: Object, callback?: (err?: ?Error) => mixed): Server; - disable(name: string): void; - disabled(name: string): boolean; - enable(name: string): void; - enabled(name: string): boolean; - engine(name: string, callback: Function): void; - /** - * Mixed will not be taken as a value option. Issue around using the GET http method name and the get for settings. - */ - // get(name: string): mixed; - set(name: string, value: mixed): mixed; - param(name: string, (req: express$Request, res: express$Response) => void): mixed; - render(name: string, optionsOrFunction: {[name: string]: mixed}, callback: express$RenderCallback): void; -} - -declare module 'express' { - declare function serveStatic(root: string, options?: Object): express$Middleware; - - declare type RouterOptions = express$RouterOptions; - declare type CookieOptions = express$CookieOptions; - declare type File = $File; - declare type Middleware = express$Middleware; - declare type NextFunction = express$NextFunction; - declare type $Response = express$Response; - declare type $Request = express$Request; - declare type $Application = express$Application; - - declare module.exports: { - (): express$Application, // If you try to call like a function, it will use this signature - static: serveStatic, // `static` property on the function - Router: typeof express$Router, // `Router` property on the function - }; -} diff --git a/flow-typed/npm/moment_v2.x.x.js b/flow-typed/npm/moment_v2.x.x.js deleted file mode 100644 index 86751112..00000000 --- a/flow-typed/npm/moment_v2.x.x.js +++ /dev/null @@ -1,233 +0,0 @@ -// flow-typed signature: 8b6a390c8f84a79f68a5ba41f3665db0 -// flow-typed version: 25c06ef4a8/moment_v2.x.x/flow_>=v0.28.x - -type moment$MomentOptions = { - y?: number|string, - year?: number|string, - years?: number|string, - M?: number|string, - month?: number|string, - months?: number|string, - d?: number|string, - day?: number|string, - days?: number|string, - date?: number|string, - h?: number|string, - hour?: number|string, - hours?: number|string, - m?: number|string, - minute?: number|string, - minutes?: number|string, - s?: number|string, - second?: number|string, - seconds?: number|string, - ms?: number|string, - millisecond?: number|string, - milliseconds?: number|string, -}; - -type moment$MomentObject = { - years: number, - months: number, - date: number, - hours: number, - minutes: number, - seconds: number, - milliseconds: number, -}; - -type moment$MomentCreationData = { - input: string, - format: string, - locale: Object, - isUTC: bool, - strict: bool, -}; - -type moment$CalendarFormats = { - sameDay?: string, - nextDay?: string, - nextWeek?: string, - lastDay?: string, - lastWeek?: string, - sameElse?: string, -}; - -declare class moment$LocaleData { - months(moment: moment$Moment): string; - monthsShort(moment: moment$Moment): string; - monthsParse(month: string): number; - weekdays(moment: moment$Moment): string; - weekdaysShort(moment: moment$Moment): string; - weekdaysMin(moment: moment$Moment): string; - weekdaysParse(weekDay: string): number; - longDateFormat(dateFormat: string): string; - isPM(date: string): bool; - meridiem(hours: number, minutes: number, isLower: bool): string; - calendar(key: 'sameDay'|'nextDay'|'lastDay'|'nextWeek'|'prevWeek'|'sameElse', moment: moment$Moment): string; - relativeTime(number: number, withoutSuffix: bool, key: 's'|'m'|'mm'|'h'|'hh'|'d'|'dd'|'M'|'MM'|'y'|'yy', isFuture: bool): string; - pastFuture(diff: any, relTime: string): string; - ordinal(number: number): string; - preparse(str: string): any; - postformat(str: string): any; - week(moment: moment$Moment): string; - invalidDate(): string; - firstDayOfWeek(): number; - firstDayOfYear(): number; -} -declare class moment$MomentDuration { - humanize(suffix?: bool): string; - milliseconds(): number; - asMilliseconds(): number; - seconds(): number; - asSeconds(): number; - minutes(): number; - asMinutes(): number; - hours(): number; - asHours(): number; - days(): number; - asDays(): number; - months(): number; - asMonths(): number; - years(): number; - asYears(): number; - add(value: number|moment$MomentDuration|Object, unit?: string): this; - subtract(value: number|moment$MomentDuration|Object, unit?: string): this; - as(unit: string): number; - get(unit: string): number; - toJSON(): string; -} -declare class moment$Moment { - static ISO_8601: string; - static (string?: string, format?: string|Array, locale?: string, strict?: bool): moment$Moment; - static (initDate: ?Object|number|Date|Array|moment$Moment|string): moment$Moment; - static unix(seconds: number): moment$Moment; - static utc(): moment$Moment; - static utc(number: number|Array): moment$Moment; - static utc(str: string, str2?: string|Array, str3?: string): moment$Moment; - static utc(moment: moment$Moment): moment$Moment; - static utc(date: Date): moment$Moment; - static parseZone(rawDate: string): moment$Moment; - isValid(): bool; - invalidAt(): 0|1|2|3|4|5|6; - creationData(): moment$MomentCreationData; - millisecond(number: number): this; - milliseconds(number: number): this; - millisecond(): number; - milliseconds(): number; - second(number: number): this; - seconds(number: number): this; - second(): number; - seconds(): number; - minute(number: number): this; - minutes(number: number): this; - minute(): number; - minutes(): number; - hour(number: number): this; - hours(number: number): this; - hour(): number; - hours(): number; - date(number: number): this; - dates(number: number): this; - date(): number; - dates(): number; - day(day: number|string): this; - days(day: number|string): this; - day(): number; - days(): number; - weekday(number: number): this; - weekday(): number; - isoWeekday(number: number): this; - isoWeekday(): number; - dayOfYear(number: number): this; - dayOfYear(): number; - week(number: number): this; - weeks(number: number): this; - week(): number; - weeks(): number; - isoWeek(number: number): this; - isoWeeks(number: number): this; - isoWeek(): number; - isoWeeks(): number; - month(number: number): this; - months(number: number): this; - month(): number; - months(): number; - quarter(number: number): this; - quarter(): number; - year(number: number): this; - years(number: number): this; - year(): number; - years(): number; - weekYear(number: number): this; - weekYear(): number; - isoWeekYear(number: number): this; - isoWeekYear(): number; - weeksInYear(): number; - isoWeeksInYear(): number; - get(string: string): number; - set(unit: string, value: number): this; - set(options: { [unit: string]: number }): this; - static max(...dates: Array): moment$Moment; - static max(dates: Array): moment$Moment; - static min(...dates: Array): moment$Moment; - static min(dates: Array): moment$Moment; - add(value: number|moment$MomentDuration|moment$Moment|Object, unit?: string): this; - subtract(value: number|moment$MomentDuration|moment$Moment|string, unit?: string): this; - startOf(unit: string): this; - endOf(unit: string): this; - local(): this; - utc(): this; - utcOffset(offset: number|string): void; - utcOffset(): number|string; - format(format?: string): string; - fromNow(removeSuffix?: bool): string; - from(value: moment$Moment|string|number|Date|Array, removePrefix?: bool): string; - toNow(removePrefix?: bool): string; - to(value: moment$Moment|string|number|Date|Array, removePrefix?: bool): string; - calendar(refTime?: any, formats?: moment$CalendarFormats): string; - diff(date: moment$Moment|string|number|Date|Array, format?: string, floating?: bool): number; - valueOf(): number; - unix(): number; - daysInMonth(): number; - toDate(): Date; - toArray(): Array; - toJSON(): string; - toISOString(): string; - toObject(): moment$MomentObject; - isBefore(date: moment$Moment|string|number|Date|Array): bool; - isSame(date: moment$Moment|string|number|Date|Array): bool; - isAfter(date: moment$Moment|string|number|Date|Array): bool; - isSameOrBefore(date: moment$Moment|string|number|Date|Array): bool; - isSameOrAfter(date: moment$Moment|string|number|Date|Array): bool; - isBetween(date: moment$Moment|string|number|Date|Array): bool; - isDST(): bool; - isDSTShifted(): bool; - isLeapYear(): bool; - clone(): moment$Moment; - static isMoment(obj: any): bool; - static isDatE(obj: any): bool; - static locale(locale: string, localeData?: Object): string; - static locale(locales: Array): string; - locale(locale: string, customization?: Object|null): moment$Moment; - locale(): string; - static months(): Array; - static monthsShort(): Array; - static weekdays(): Array; - static weekdaysShort(): Array; - static weekdaysMin(): Array; - static months(): string; - static monthsShort(): string; - static weekdays(): string; - static weekdaysShort(): string; - static weekdaysMin(): string; - static localeData(key?: string): moment$LocaleData; - static duration(value: number|Object|string, unit?: string): moment$MomentDuration; - static isDuration(obj: any): bool; - static normalizeUnits(unit: string): string; - static invalid(object: any): moment$Moment; -} - -declare module 'moment' { - declare module.exports: Class; -} diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..743b3bb2 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,8 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/**/*.test.ts'], + setupFilesAfterEnv: ['/src/setup-jest.ts'], + openHandlesTimeout: 1000, +}; diff --git a/lerna.json b/lerna.json new file mode 100644 index 00000000..f6604bd4 --- /dev/null +++ b/lerna.json @@ -0,0 +1,4 @@ +{ + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "version": "0.0.0" +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..7ef8f377 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,19274 @@ +{ + "name": "@brewskey/spark-server", + "version": "1.0.3", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@brewskey/spark-server", + "version": "1.0.3", + "license": "AGPL-3.0", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@brewskey/spark-protocol": "^1.0.0", + "basic-auth-parser": "0.0.2", + "binary-version-reader": "^2.4.0", + "body-parser": "^1.20.2", + "bunyan": "^1.8.15", + "bunyan-middleware": "^1.0.2", + "constitute": "^1.6.2", + "cors": "^2.8.5", + "csv": "^6.3.6", + "ec-key": "^0.0.4", + "express": "^4.18.2", + "express-oauth-server": "^2.0.0", + "hogan.js": "^3.0.2", + "lodash": "^4.17.21", + "mkdirp": "^3.0.1", + "moment": "^2.30.1", + "mongodb": "^6.3.0", + "morgan": "^1.10.0", + "multer": "^1.2.1", + "nedb-core": "https://github.com/bnielsen1965/nedb-core", + "node-rsa": "^1.1.1", + "nullthrows": "^1.1.1", + "request": "^2.83.0", + "rmfr": "^2.0.0", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@octokit/rest": "^20.0.2", + "@types/cors": "^2.8.17", + "@types/express-bunyan-logger": "^1.3.6", + "@types/express-oauth-server": "^2.0.7", + "@types/hogan.js": "^3.0.5", + "@types/jest": "^29.5.12", + "@types/lodash": "^4.14.202", + "@types/multer": "^1.4.11", + "@types/request": "^2.48.12", + "@types/rmfr": "^2.0.5", + "@types/sinon": "^17.0.3", + "@types/supertest": "^6.0.2", + "@types/uuid": "^9.0.8", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.2.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-prettier": "^5.1.3", + "jest": "^29.7.0", + "lerna": "^8.1.2", + "lint-staged": "^15.2.2", + "nodemon": "^3.0.3", + "pre-commit": "^1.2.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "sinon": "^17.0.1", + "supertest": "^6.3.4", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", + "typescript": "^5.3.3", + "uglifyjs": "^2.4.10" + }, + "optionalDependencies": { + "@nx/nx-darwin-arm64": "16.8.1", + "@nx/nx-darwin-x64": "16.8.1", + "@nx/nx-linux-x64-gnu": "16.8.1", + "@nx/nx-linux-x64-musl": "16.8.1", + "@nx/nx-win32-x64-msvc": "16.8.1" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.23.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.23.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.9", + "@babel/parser": "^7.23.9", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/json5": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.23.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.23.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.15", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.23.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.23.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.23.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.23.9", + "dev": true, + "license": "MIT", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.23.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.23.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.23.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/types": { + "version": "7.23.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@brewskey/spark-protocol": { + "resolved": "packages/spark-protocol", + "link": true + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.6.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@hutson/parse-repository-url": { + "version": "3.0.2", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/console/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@jest/core/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/core/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/core/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core/node_modules/leven": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@jest/core/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/reporters/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/transform/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.22", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lerna/create": { + "version": "8.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@npmcli/run-script": "7.0.2", + "@nx/devkit": ">=17.1.2 < 19", + "@octokit/plugin-enterprise-rest": "6.0.1", + "@octokit/rest": "19.0.11", + "byte-size": "8.1.1", + "chalk": "4.1.0", + "clone-deep": "4.0.1", + "cmd-shim": "6.0.1", + "columnify": "1.6.0", + "conventional-changelog-core": "5.0.1", + "conventional-recommended-bump": "7.0.1", + "cosmiconfig": "^8.2.0", + "dedent": "0.7.0", + "execa": "5.0.0", + "fs-extra": "^11.1.1", + "get-stream": "6.0.0", + "git-url-parse": "13.1.0", + "glob-parent": "5.1.2", + "globby": "11.1.0", + "graceful-fs": "4.2.11", + "has-unicode": "2.0.1", + "ini": "^1.3.8", + "init-package-json": "5.0.0", + "inquirer": "^8.2.4", + "is-ci": "3.0.1", + "is-stream": "2.0.0", + "js-yaml": "4.1.0", + "libnpmpublish": "7.3.0", + "load-json-file": "6.2.0", + "lodash": "^4.17.21", + "make-dir": "4.0.0", + "minimatch": "3.0.5", + "multimatch": "5.0.0", + "node-fetch": "2.6.7", + "npm-package-arg": "8.1.1", + "npm-packlist": "5.1.1", + "npm-registry-fetch": "^14.0.5", + "npmlog": "^6.0.2", + "nx": ">=17.1.2 < 19", + "p-map": "4.0.0", + "p-map-series": "2.1.0", + "p-queue": "6.6.2", + "p-reduce": "^2.1.0", + "pacote": "^17.0.5", + "pify": "5.0.0", + "read-cmd-shim": "4.0.0", + "read-package-json": "6.0.4", + "resolve-from": "5.0.0", + "rimraf": "^4.4.1", + "semver": "^7.3.4", + "signal-exit": "3.0.7", + "slash": "^3.0.0", + "ssri": "^9.0.1", + "strong-log-transformer": "2.1.0", + "tar": "6.1.11", + "temp-dir": "1.0.0", + "upath": "2.0.1", + "uuid": "^9.0.0", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "5.0.0", + "write-file-atomic": "5.0.1", + "write-pkg": "4.0.0", + "yargs": "17.7.2", + "yargs-parser": "21.1.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/auth-token": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/core": { + "version": "4.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/endpoint": { + "version": "7.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/graphql": { + "version": "5.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^9.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/@lerna/create/node_modules/@octokit/plugin-paginate-rest": { + "version": "6.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/tsconfig": "^1.0.2", + "@octokit/types": "^9.2.3" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "7.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^10.0.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "10.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/request": { + "version": "6.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/request-error": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^9.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/rest": { + "version": "19.0.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/core": "^4.2.1", + "@octokit/plugin-paginate-rest": "^6.1.2", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^7.1.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@lerna/create/node_modules/@octokit/types": { + "version": "9.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/@lerna/create/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@lerna/create/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/@lerna/create/node_modules/chalk": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@lerna/create/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@lerna/create/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@lerna/create/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@lerna/create/node_modules/dedent": { + "version": "0.7.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@lerna/create/node_modules/execa": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/@lerna/create/node_modules/get-stream": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@lerna/create/node_modules/glob": { + "version": "9.3.5", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@lerna/create/node_modules/glob-parent": { + "version": "5.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@lerna/create/node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@lerna/create/node_modules/glob/node_modules/minimatch": { + "version": "8.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@lerna/create/node_modules/is-plain-object": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/create/node_modules/is-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@lerna/create/node_modules/minimatch": { + "version": "3.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@lerna/create/node_modules/minipass": { + "version": "4.2.8", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@lerna/create/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/rimraf": { + "version": "4.4.1", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^9.2.0" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@lerna/create/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/create/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@lerna/create/node_modules/write-file-atomic": { + "version": "5.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@lerna/create/node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.4", + "license": "MIT", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/agent": { + "version": "2.2.1", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/agent/node_modules/lru-cache": { + "version": "10.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/@npmcli/fs": { + "version": "3.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/git": { + "version": "5.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/promise-spawn": "^7.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/git/node_modules/isexe": { + "version": "3.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/git/node_modules/lru-cache": { + "version": "10.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/@npmcli/git/node_modules/which": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "lib/index.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled": { + "version": "3.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/installed-package-contents/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/node-gyp": { + "version": "3.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/promise-spawn": { + "version": "7.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/isexe": { + "version": "3.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/which": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/run-script": { + "version": "7.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "node-gyp": "^10.0.0", + "read-package-json-fast": "^3.0.0", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/run-script/node_modules/isexe": { + "version": "3.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/run-script/node_modules/which": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/@nrwl/devkit": { + "version": "18.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@nx/devkit": "18.0.4" + } + }, + "node_modules/@nrwl/tao": { + "version": "18.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "nx": "18.0.4", + "tslib": "^2.3.0" + }, + "bin": { + "tao": "index.js" + } + }, + "node_modules/@nx/devkit": { + "version": "18.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@nrwl/devkit": "18.0.4", + "ejs": "^3.1.7", + "enquirer": "~2.3.6", + "ignore": "^5.0.4", + "semver": "^7.5.3", + "tmp": "~0.2.1", + "tslib": "^2.3.0", + "yargs-parser": "21.1.1" + }, + "peerDependencies": { + "nx": ">= 16 <= 18" + } + }, + "node_modules/@nx/devkit/node_modules/enquirer": { + "version": "2.3.6", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/@nx/devkit/node_modules/ignore": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@nx/nx-darwin-arm64": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.8.1.tgz", + "integrity": "sha512-xOflqyIVcyLPzdJOZcucI+5ClwnTgK8zIvpjbxHokrO9McJJglhfUyP0bbTHpEpWqzA+GaPA/6/Qdu0ATzqQBQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-darwin-x64": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-16.8.1.tgz", + "integrity": "sha512-JJGrlOvEpDMWnM6YKaA1WOnzHgiw5vRKEowX9ba+jxhmCvtdjbLSxi228kv92JtQPPQ91zvtsNM+BFY0EbPOlA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-freebsd-x64": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-18.0.4.tgz", + "integrity": "sha512-jJx47wgRoUxVpQ+WG5+yLdxtJVuVgjphiTMRc0LOfUwKQaEHWyCA0hMK5fNmo0FAHIhGVCb/j2j9FxnCWTWpkg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-linux-arm-gnueabihf": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-18.0.4.tgz", + "integrity": "sha512-C3qWbFhEMIdTzvAHlIUHecZN3YBu7bx3S0p3gPNGmEMUMbYHP2zMlimBrZIbAxzntyGqWCqhXiFB21QhJ0t1Dw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-linux-arm64-gnu": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-18.0.4.tgz", + "integrity": "sha512-PxVMh9ikp8Q3hKagb66FAsek8O/08GcMF5dXBH7xc5AiQMaZ6Az/gAXOeHp274nmu3StQEpl9Il/YH6Z9f4V0w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-linux-arm64-musl": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-18.0.4.tgz", + "integrity": "sha512-Iz7Z4h2/dXJJvBcyeRHa+d3Ncc4Qz+OiGm6iRDXv4zjFm5EyC1tkSZIFNlNiRjmTToNHFr4savrCjCh8wRYejw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-linux-x64-gnu": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.8.1.tgz", + "integrity": "sha512-lHvv2FD14Lpxh7muMLStH2tC1opQOaepO4nXwb1LaaoIpMym7kBgCK8AQuI98/oNQiMDXMNDKWQZCjxnJGDIPw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-linux-x64-musl": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.8.1.tgz", + "integrity": "sha512-c4gQvNgIjggD1A5sYhftQEC1PtAhV3sEnv60X00v9wmjl57Wj4Ty0TgyzpYglLysVRiko/B58S8NYS0jKvMmeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-win32-arm64-msvc": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-18.0.4.tgz", + "integrity": "sha512-YoxhOrVKnS+kcNTnCg9M61cbigzGErYgnlI8kdZzH2ArD7mhv8bfZnSZUInf5Y8oDBVpKusel7AkCSofzSwigA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nx/nx-win32-x64-msvc": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.8.1.tgz", + "integrity": "sha512-yHZ5FAcx54rVc31R0yIpniepkHMPwaxG23l8E/ZYbL1iPwE/Wc1HeUzUvxUuSXtguRp7ihcRhaUEPkcSl2EAVw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.0.0", + "@octokit/request": "^8.0.2", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^8.0.1", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "19.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-enterprise-rest": { + "version": "6.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "9.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.4.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "10.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.3.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/request": { + "version": "8.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^9.0.0", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/rest": { + "version": "20.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/core": "^5.0.0", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-request-log": "^4.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/tsconfig": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/types": { + "version": "12.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^19.1.0" + } + }, + "node_modules/@particle/device-constants": { + "version": "3.3.1", + "license": "UNLICENSED", + "engines": { + "node": ">=12.x", + "npm": "8.x" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@sigstore/bundle": { + "version": "1.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.2.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/core": { + "version": "1.0.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/protobuf-specs": { + "version": "0.2.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign": { + "version": "1.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^1.1.0", + "@sigstore/protobuf-specs": "^0.2.0", + "make-fetch-happen": "^11.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/cacache": { + "version": "17.1.4", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^7.7.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@sigstore/sign/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sigstore/sign/node_modules/http-proxy-agent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@sigstore/sign/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@sigstore/sign/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/@sigstore/sign/node_modules/make-fetch-happen": { + "version": "11.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/make-fetch-happen/node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sigstore/sign/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@sigstore/sign/node_modules/minipass-collect": { + "version": "1.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sigstore/sign/node_modules/minipass-collect/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sigstore/sign/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@sigstore/sign/node_modules/socks-proxy-agent": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@sigstore/sign/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/@sigstore/tuf": { + "version": "1.0.3", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.2.0", + "tuf-js": "^1.1.7" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/verify": { + "version": "1.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/verify/node_modules/@sigstore/bundle": { + "version": "2.2.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/verify/node_modules/@sigstore/protobuf-specs": { + "version": "0.3.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "8.0.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^2.0.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { + "version": "2.0.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.2", + "dev": true, + "license": "(Unlicense OR Apache-2.0)" + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@tufjs/canonical-json": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/canonical-json": "1.0.0", + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@tufjs/models/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/buffer-crc32": { + "version": "0.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/bunyan": { + "version": "1.8.11", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cookiejar": { + "version": "2.1.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cors": { + "version": "2.8.17", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-bunyan-logger": { + "version": "1.3.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/bunyan": "*", + "@types/express": "*" + } + }, + "node_modules/@types/express-oauth-server": { + "version": "2.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*", + "@types/oauth2-server": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.43", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/glob": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/minimatch": "^5.1.2", + "@types/node": "*" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/hogan.js": { + "version": "3.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jest/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@types/jest/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/lodash": { + "version": "4.14.202", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/methods": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "license": "MIT" + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/multer": { + "version": "1.4.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.17", + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-rsa": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/oauth2-server": { + "version": "3.0.16", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/qs": { + "version": "6.9.11", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "license": "MIT" + }, + "node_modules/@types/request": { + "version": "2.48.12", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/request/node_modules/form-data": { + "version": "2.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/@types/rimraf": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/glob": "*", + "@types/node": "*" + } + }, + "node_modules/@types/rmfr": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/rimraf": "^2.0.3" + } + }, + "node_modules/@types/semver": { + "version": "7.5.7", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.4", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.5", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/@types/sinon": { + "version": "17.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/sinonjs__fake-timers": "*" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/superagent": { + "version": "8.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/cookiejar": "^2.1.5", + "@types/methods": "^1.1.4", + "@types/node": "*" + } + }, + "node_modules/@types/supertest": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/methods": "^1.1.4", + "@types/superagent": "^8.1.0" + } + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/uuid": { + "version": "9.0.8", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "license": "MIT" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.4", + "license": "MIT", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.32", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "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" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.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/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.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/@yarnpkg/lockfile": { + "version": "1.1.0", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/@yarnpkg/parsers": { + "version": "3.0.0-rc.46", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "js-yaml": "^3.10.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=14.15.0" + } + }, + "node_modules/@zkochan/js-yaml": { + "version": "0.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@zkochan/js-yaml/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/abbrev": { + "version": "1.1.1", + "license": "ISC" + }, + "node_modules/accepts": { + "version": "1.3.8", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/add-stream": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/agent-base": { + "version": "7.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "dev": true, + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "6.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "3.13.1", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/append-field": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/append-type": { + "version": "1.0.2", + "license": "MIT-0" + }, + "node_modules/aproba": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/archiver": { + "version": "5.3.2", + "license": "MIT", + "dependencies": { + "archiver-utils": "^2.1.0", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/archiver-utils": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/archiver-utils/node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/archiver-utils/node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/archiver-utils/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/archiver-utils/node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/archiver/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/archiver/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/are-we-there-yet/node_modules/string_decoder": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "1.0.10", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-differ": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/array-ify": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/array-includes": { + "version": "3.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-to-sentence": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/array-union": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.filter": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/asn1": { + "version": "0.2.6", + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/asn1.js": { + "version": "5.4.1", + "license": "MIT", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/assert-valid-glob-opts": { + "version": "1.0.0", + "license": "CC0-1.0", + "dependencies": { + "glob-option-error": "^1.0.0", + "validate-glob-opts": "^1.0.0" + } + }, + "node_modules/async": { + "version": "3.2.5", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.6", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.12.0", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.6.7", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/babel-jest/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/basic-auth-parser": { + "version": "0.0.2" + }, + "node_modules/basic-auth/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/big-integer": { + "version": "1.6.52", + "license": "Unlicense", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/binary": { + "version": "0.3.0", + "license": "MIT", + "dependencies": { + "buffers": "~0.1.1", + "chainsaw": "~0.1.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/binary-version-reader": { + "version": "2.4.0", + "resolved": "git+ssh://git@github.com/particle-iot/binary-version-reader.git#1a59b3ad5cc8a126ceb1498bb4c6d433954bb38a", + "license": "Apache-2.0", + "dependencies": { + "archiver": "^5.3.1", + "buffer-crc32": "^0.2.5", + "tmp-promise": "^3.0.3", + "unzipper": "^0.10.11", + "xtend": "^4.0.2" + }, + "bin": { + "pmod": "bin/pmod.js" + }, + "engines": { + "node": ">=12", + "npm": "8.x" + }, + "peerDependencies": { + "@particle/device-constants": "^3.2.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bl/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "license": "MIT" + }, + "node_modules/bn.js": { + "version": "4.12.0", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.22.3", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/bson": { + "version": "6.3.0", + "license": "Apache-2.0", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "license": "MIT" + }, + "node_modules/buffer-indexof-polyfill": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/buffers": { + "version": "0.1.1", + "engines": { + "node": ">=0.2.0" + } + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" + }, + "node_modules/builtins": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/bunyan": { + "version": "1.8.15", + "engines": [ + "node >=0.10.0" + ], + "license": "MIT", + "bin": { + "bunyan": "bin/bunyan" + }, + "optionalDependencies": { + "dtrace-provider": "~0.8", + "moment": "^2.19.3", + "mv": "~2", + "safe-json-stringify": "~1" + } + }, + "node_modules/bunyan-middleware": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "@types/bunyan": "^1.8.6", + "@types/express": "^4.0.35", + "uuid": "^8.3.2" + } + }, + "node_modules/bunyan-middleware/node_modules/uuid": { + "version": "8.3.2", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/busboy": { + "version": "0.2.14", + "dependencies": { + "dicer": "0.2.5", + "readable-stream": "1.1.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/byte-size": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.17" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "18.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "10.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/cacache/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.6", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "set-function-length": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001587", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/caseless": { + "version": "0.12.0", + "license": "Apache-2.0" + }, + "node_modules/chainsaw": { + "version": "0.1.0", + "license": "MIT/X11", + "dependencies": { + "traverse": ">=0.3.0 <0.4" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "dev": true, + "license": "MIT" + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.6.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/cmd-shim": { + "version": "6.0.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/co-bluebird": { + "version": "1.1.0", + "dependencies": { + "bluebird": "^2.10.0", + "co-use": "^1.1.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/co-bluebird/node_modules/bluebird": { + "version": "2.11.0", + "license": "MIT" + }, + "node_modules/co-use": { + "version": "1.1.0", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/coap-packet": { + "version": "1.1.1", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/color-support": { + "version": "1.1.3", + "dev": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colorette": { + "version": "2.0.20", + "dev": true, + "license": "MIT" + }, + "node_modules/columnify": { + "version": "1.6.0", + "dev": true, + "license": "MIT", + "dependencies": { + "strip-ansi": "^6.0.1", + "wcwidth": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/columnify/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/columnify/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "11.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/compare-func": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/compress-commons": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/compress-commons/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/compress-commons/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "dev": true, + "license": "MIT" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "dev": true, + "license": "ISC" + }, + "node_modules/constitute": { + "version": "1.6.2", + "license": "ISC", + "dependencies": { + "clone": "^1.0.2" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/conventional-changelog-angular": { + "version": "7.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-changelog-core": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "add-stream": "^1.0.0", + "conventional-changelog-writer": "^6.0.0", + "conventional-commits-parser": "^4.0.0", + "dateformat": "^3.0.3", + "get-pkg-repo": "^4.2.1", + "git-raw-commits": "^3.0.0", + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^5.0.0", + "normalize-package-data": "^3.0.3", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/conventional-changelog-preset-loader": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/conventional-changelog-writer": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "conventional-commits-filter": "^3.0.0", + "dateformat": "^3.0.3", + "handlebars": "^4.7.7", + "json-stringify-safe": "^5.0.1", + "meow": "^8.1.2", + "semver": "^7.0.0", + "split": "^1.0.1" + }, + "bin": { + "conventional-changelog-writer": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/conventional-commits-filter": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/conventional-commits-parser": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-text-path": "^1.0.1", + "JSONStream": "^1.3.5", + "meow": "^8.1.2", + "split2": "^3.2.2" + }, + "bin": { + "conventional-commits-parser": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/conventional-recommended-bump": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "concat-stream": "^2.0.0", + "conventional-changelog-preset-loader": "^3.0.0", + "conventional-commits-filter": "^3.0.0", + "conventional-commits-parser": "^4.0.0", + "git-raw-commits": "^3.0.0", + "git-semver-tags": "^5.0.0", + "meow": "^8.1.2" + }, + "bin": { + "conventional-recommended-bump": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/conventional-recommended-bump/node_modules/concat-stream": { + "version": "2.0.0", + "dev": true, + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/conventional-recommended-bump/node_modules/readable-stream": { + "version": "3.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/conventional-recommended-bump/node_modules/string_decoder": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.5.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "license": "MIT" + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cosmiconfig": { + "version": "8.3.6", + "dev": true, + "license": "MIT", + "dependencies": { + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cosmiconfig/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/cosmiconfig/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/crc-32": { + "version": "1.2.2", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/crc32-stream/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/crc32-stream/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/create-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-jest/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/create-require": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/csv": { + "version": "6.3.6", + "license": "MIT", + "dependencies": { + "csv-generate": "^4.3.1", + "csv-parse": "^5.5.3", + "csv-stringify": "^6.4.5", + "stream-transform": "^3.3.0" + }, + "engines": { + "node": ">= 0.1.90" + } + }, + "node_modules/csv-generate": { + "version": "4.3.1", + "license": "MIT" + }, + "node_modules/csv-parse": { + "version": "5.5.3", + "license": "MIT" + }, + "node_modules/csv-stringify": { + "version": "6.4.5", + "license": "MIT" + }, + "node_modules/dargs": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/dateformat": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dedent": { + "version": "1.5.1", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.3", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/depd": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/deprecation": { + "version": "2.3.1", + "dev": true, + "license": "ISC" + }, + "node_modules/destroy": { + "version": "1.2.0", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-indent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/dicer": { + "version": "0.2.5", + "dependencies": { + "readable-stream": "1.1.x", + "streamsearch": "0.1.2" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.4.4", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-expand": { + "version": "10.0.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/dtrace-provider": { + "version": "0.8.8", + "hasInstallScript": true, + "license": "BSD-2-Clause", + "optional": true, + "dependencies": { + "nan": "^2.14.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/duplexer": { + "version": "0.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/duplexer2": { + "version": "0.1.4", + "license": "BSD-3-Clause", + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/duplexer2/node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/duplexer2/node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexer2/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/duplexer2/node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/ec-key": { + "version": "0.0.4", + "license": "MIT", + "dependencies": { + "asn1.js": "^5.2.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/ejs": { + "version": "3.1.9", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.667", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/enquirer/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/enquirer/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/envinfo": { + "version": "7.8.1", + "dev": true, + "license": "MIT", + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "license": "MIT" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.22.3", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.5", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.2", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-array-method-boxes-properly": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/es-errors": { + "version": "1.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.2", + "has-tostringtag": "^1.0.0", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint/eslintrc": "^1.0.4", + "@humanwhocodes/config-array": "^0.6.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^6.0.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.0.0", + "espree": "^9.0.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" + } + }, + "node_modules/eslint-config-airbnb-base/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-config-airbnb-typescript": { + "version": "17.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-config-airbnb-base": "^15.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^5.13.0 || ^6.0.0", + "@typescript-eslint/parser": "^5.0.0 || ^6.0.0", + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.3" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "6.0.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/execa": { + "version": "8.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/execa/node_modules/human-signals": { + "version": "5.0.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/execa/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/execa/node_modules/strip-final-newline": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/expect/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.1", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/express": { + "version": "4.18.2", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express-oauth-server": { + "version": "2.0.0", + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "bluebird": "^3.0.5", + "express": "^4.13.3", + "oauth2-server": "3.0.0" + }, + "engines": { + "node": ">=0.11" + } + }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/external-editor/node_modules/tmp": { + "version": "0.0.33", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.17.1", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.5", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/foreground-child/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/formidable": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "dezalgo": "^1.0.4", + "hexoid": "^1.0.0", + "once": "^1.4.0", + "qs": "^6.11.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/fstream": { + "version": "1.0.12", + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/fstream/node_modules/mkdirp": { + "version": "0.5.6", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/fstream/node_modules/rimraf": { + "version": "2.7.1", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "4.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/gauge/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-pkg-repo": { + "version": "4.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@hutson/parse-repository-url": "^3.0.0", + "hosted-git-info": "^4.0.0", + "through2": "^2.0.0", + "yargs": "^16.2.0" + }, + "bin": { + "get-pkg-repo": "src/cli.js" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-pkg-repo/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/get-pkg-repo/node_modules/cliui": { + "version": "7.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/get-pkg-repo/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/get-pkg-repo/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-pkg-repo/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-pkg-repo/node_modules/yargs": { + "version": "16.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/get-pkg-repo/node_modules/yargs-parser": { + "version": "20.2.9", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/get-port": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/git-raw-commits": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "dargs": "^7.0.0", + "meow": "^8.1.2", + "split2": "^3.2.2" + }, + "bin": { + "git-raw-commits": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/git-remote-origin-url": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/git-remote-origin-url/node_modules/pify": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/git-semver-tags": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "meow": "^8.1.2", + "semver": "^7.0.0" + }, + "bin": { + "git-semver-tags": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/git-up": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-ssh": "^1.4.0", + "parse-url": "^8.1.0" + } + }, + "node_modules/git-url-parse": { + "version": "13.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "git-up": "^7.0.0" + } + }, + "node_modules/gitconfiglocal": { + "version": "1.0.0", + "dev": true, + "license": "BSD", + "dependencies": { + "ini": "^1.3.2" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-option-error": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/handlebars": { + "version": "4.7.8", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "dev": true, + "license": "ISC" + }, + "node_modules/hasown": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hexoid": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hogan.js": { + "version": "3.0.2", + "dependencies": { + "mkdirp": "0.3.0", + "nopt": "1.0.10" + }, + "bin": { + "hulk": "bin/hulk" + } + }, + "node_modules/hogan.js/node_modules/mkdirp": { + "version": "0.3.0", + "license": "MIT/X11", + "engines": { + "node": "*" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/http-signature": { + "version": "1.2.0", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/human-signals": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "4.0.6", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "node_modules/ignore-walk": { + "version": "5.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "minimatch": "^5.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ignore-walk/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/ignore-walk/node_modules/minimatch": { + "version": "5.1.6", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "license": "MIT" + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/indexed-filter": { + "version": "1.0.3", + "license": "ISC", + "dependencies": { + "append-type": "^1.0.1" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "dev": true, + "license": "ISC" + }, + "node_modules/init-package-json": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-package-arg": "^10.0.0", + "promzard": "^1.0.0", + "read": "^2.0.0", + "read-package-json": "^6.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/init-package-json/node_modules/hosted-git-info": { + "version": "6.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/init-package-json/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/init-package-json/node_modules/npm-package-arg": { + "version": "10.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/inquirer": { + "version": "8.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/cli-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/inquirer/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/restore-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "6.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inspect-with-kind": { + "version": "1.0.5", + "license": "ISC", + "dependencies": { + "kind-of": "^6.0.2" + } + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "devOptional": true, + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/jsbn": { + "version": "1.1.0", + "devOptional": true, + "license": "MIT" + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "devOptional": true, + "license": "BSD-3-Clause" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is": { + "version": "3.3.0", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "dev": true, + "license": "MIT" + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-ci": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-generator": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-ssh": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "protocols": "^2.0.1" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-text-path": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "text-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/isobject": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isstream": { + "version": "0.1.2", + "license": "MIT" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jake": { + "version": "10.8.7", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jake/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jake/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jake/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jake/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-changed-files/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/jest-changed-files/node_modules/execa": { + "version": "5.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/jest-changed-files/node_modules/get-stream": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/is-stream": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-circus/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-cli/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli/node_modules/leven": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/jest-cli/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-config/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-config/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-config/node_modules/leven": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/jest-config/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-config/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-diff/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-each/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-leak-detector/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-matcher-utils/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-message-util/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-message-util/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-resolve/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-resolve/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/leven": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/jest-resolve/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runner/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runtime/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-runtime/node_modules/strip-bom": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-snapshot/node_modules/jest-get-type": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/pretty-format": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-watcher/node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-watcher/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-watcher/node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "2.5.2", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "license": "ISC" + }, + "node_modules/json5": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "dev": true, + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jsprim": { + "version": "1.4.2", + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/just-extend": { + "version": "6.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lerna": { + "version": "8.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@lerna/create": "8.1.2", + "@npmcli/run-script": "7.0.2", + "@nx/devkit": ">=17.1.2 < 19", + "@octokit/plugin-enterprise-rest": "6.0.1", + "@octokit/rest": "19.0.11", + "byte-size": "8.1.1", + "chalk": "4.1.0", + "clone-deep": "4.0.1", + "cmd-shim": "6.0.1", + "columnify": "1.6.0", + "conventional-changelog-angular": "7.0.0", + "conventional-changelog-core": "5.0.1", + "conventional-recommended-bump": "7.0.1", + "cosmiconfig": "^8.2.0", + "dedent": "0.7.0", + "envinfo": "7.8.1", + "execa": "5.0.0", + "fs-extra": "^11.1.1", + "get-port": "5.1.1", + "get-stream": "6.0.0", + "git-url-parse": "13.1.0", + "glob-parent": "5.1.2", + "globby": "11.1.0", + "graceful-fs": "4.2.11", + "has-unicode": "2.0.1", + "import-local": "3.1.0", + "ini": "^1.3.8", + "init-package-json": "5.0.0", + "inquirer": "^8.2.4", + "is-ci": "3.0.1", + "is-stream": "2.0.0", + "jest-diff": ">=29.4.3 < 30", + "js-yaml": "4.1.0", + "libnpmaccess": "7.0.2", + "libnpmpublish": "7.3.0", + "load-json-file": "6.2.0", + "lodash": "^4.17.21", + "make-dir": "4.0.0", + "minimatch": "3.0.5", + "multimatch": "5.0.0", + "node-fetch": "2.6.7", + "npm-package-arg": "8.1.1", + "npm-packlist": "5.1.1", + "npm-registry-fetch": "^14.0.5", + "npmlog": "^6.0.2", + "nx": ">=17.1.2 < 19", + "p-map": "4.0.0", + "p-map-series": "2.1.0", + "p-pipe": "3.1.0", + "p-queue": "6.6.2", + "p-reduce": "2.1.0", + "p-waterfall": "2.1.1", + "pacote": "^17.0.5", + "pify": "5.0.0", + "read-cmd-shim": "4.0.0", + "read-package-json": "6.0.4", + "resolve-from": "5.0.0", + "rimraf": "^4.4.1", + "semver": "^7.3.8", + "signal-exit": "3.0.7", + "slash": "3.0.0", + "ssri": "^9.0.1", + "strong-log-transformer": "2.1.0", + "tar": "6.1.11", + "temp-dir": "1.0.0", + "typescript": ">=3 < 6", + "upath": "2.0.1", + "uuid": "^9.0.0", + "validate-npm-package-license": "3.0.4", + "validate-npm-package-name": "5.0.0", + "write-file-atomic": "5.0.1", + "write-pkg": "4.0.0", + "yargs": "17.7.2", + "yargs-parser": "21.1.1" + }, + "bin": { + "lerna": "dist/cli.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/lerna/node_modules/@octokit/auth-token": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/core": { + "version": "4.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/endpoint": { + "version": "7.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/graphql": { + "version": "5.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^9.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/lerna/node_modules/@octokit/plugin-paginate-rest": { + "version": "6.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/tsconfig": "^1.0.2", + "@octokit/types": "^9.2.3" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/lerna/node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/lerna/node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "7.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^10.0.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/lerna/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "10.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/lerna/node_modules/@octokit/request": { + "version": "6.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/request-error": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^9.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/rest": { + "version": "19.0.11", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/core": "^4.2.1", + "@octokit/plugin-paginate-rest": "^6.1.2", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^7.1.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/lerna/node_modules/@octokit/types": { + "version": "9.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/lerna/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/lerna/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/lerna/node_modules/chalk": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/lerna/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/lerna/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/lerna/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/lerna/node_modules/dedent": { + "version": "0.7.0", + "dev": true, + "license": "MIT" + }, + "node_modules/lerna/node_modules/execa": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/lerna/node_modules/get-stream": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lerna/node_modules/glob": { + "version": "9.3.5", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/lerna/node_modules/glob-parent": { + "version": "5.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/lerna/node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/lerna/node_modules/glob/node_modules/minimatch": { + "version": "8.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/lerna/node_modules/is-plain-object": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lerna/node_modules/is-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/lerna/node_modules/minimatch": { + "version": "3.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/lerna/node_modules/minipass": { + "version": "4.2.8", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lerna/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/rimraf": { + "version": "4.4.1", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^9.2.0" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/lerna/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/lerna/node_modules/write-file-atomic": { + "version": "5.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/lerna/node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/libnpmaccess": { + "version": "7.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-package-arg": "^10.1.0", + "npm-registry-fetch": "^14.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmaccess/node_modules/hosted-git-info": { + "version": "6.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmaccess/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/libnpmaccess/node_modules/npm-package-arg": { + "version": "10.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmpublish": { + "version": "7.3.0", + "dev": true, + "license": "ISC", + "dependencies": { + "ci-info": "^3.6.1", + "normalize-package-data": "^5.0.0", + "npm-package-arg": "^10.1.0", + "npm-registry-fetch": "^14.0.3", + "proc-log": "^3.0.0", + "semver": "^7.3.7", + "sigstore": "^1.4.0", + "ssri": "^10.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmpublish/node_modules/hosted-git-info": { + "version": "6.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmpublish/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/libnpmpublish/node_modules/normalize-package-data": { + "version": "5.0.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmpublish/node_modules/npm-package-arg": { + "version": "10.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/libnpmpublish/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/lie": { + "version": "3.1.1", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/lilconfig": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "dev": true, + "license": "MIT" + }, + "node_modules/lint-staged": { + "version": "15.2.2", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "5.3.0", + "commander": "11.1.0", + "debug": "4.3.4", + "execa": "8.0.1", + "lilconfig": "3.0.0", + "listr2": "8.0.1", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.4" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/lint-staged/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/listenercount": { + "version": "1.0.1", + "license": "ISC" + }, + "node_modules/listr2": { + "version": "8.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.0.0", + "rfdc": "^1.3.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/load-json-file": { + "version": "6.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.15", + "parse-json": "^5.0.0", + "strip-bom": "^4.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/load-json-file/node_modules/type-fest": { + "version": "0.6.0", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/localforage": { + "version": "1.10.0", + "license": "Apache-2.0", + "dependencies": { + "lie": "3.1.1" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "license": "MIT" + }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "license": "MIT" + }, + "node_modules/lodash.difference": { + "version": "4.5.0", + "license": "MIT" + }, + "node_modules/lodash.flatten": { + "version": "4.4.0", + "license": "MIT" + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.ismatch": { + "version": "4.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "license": "MIT" + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.union": { + "version": "4.6.0", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/log-update": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^6.2.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lru-cache": { + "version": "4.1.5", + "dev": true, + "license": "ISC", + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "node_modules/make-fetch-happen": { + "version": "13.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "license": "MIT" + }, + "node_modules/meow": { + "version": "8.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/hosted-git-info": { + "version": "2.8.9", + "dev": true, + "license": "ISC" + }, + "node_modules/meow/node_modules/read-pkg": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/meow/node_modules/read-pkg-up": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/meow/node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/meow/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/yargs-parser": { + "version": "20.2.9", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "license": "ISC" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-json-stream": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "node_modules/minipass-json-stream/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-json-stream/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/minizlib": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/modify-values": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/mongodb": { + "version": "6.3.0", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.0", + "bson": "^6.2.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/moniker": { + "version": "0.1.2" + }, + "node_modules/morgan": { + "version": "1.10.0", + "license": "MIT", + "dependencies": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/on-finished": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/multer": { + "version": "1.4.4", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^0.2.11", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "on-finished": "^2.3.0", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/multer/node_modules/mkdirp": { + "version": "0.5.6", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/multimatch": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/multimatch/node_modules/@types/minimatch": { + "version": "3.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/multimatch/node_modules/arrify": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "dev": true, + "license": "ISC" + }, + "node_modules/mv": { + "version": "2.1.1", + "license": "MIT", + "optional": true, + "dependencies": { + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/mv/node_modules/glob": { + "version": "6.0.4", + "license": "ISC", + "optional": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mv/node_modules/mkdirp": { + "version": "0.5.6", + "license": "MIT", + "optional": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mv/node_modules/rimraf": { + "version": "2.4.5", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^6.0.1" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/nan": { + "version": "2.18.0", + "license": "MIT", + "optional": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/ncp": { + "version": "2.0.0", + "license": "MIT", + "optional": true, + "bin": { + "ncp": "bin/ncp" + } + }, + "node_modules/nedb-core": { + "version": "3.0.7", + "resolved": "git+ssh://git@github.com/bnielsen1965/nedb-core.git#0b03bc384184808b3fe4bbea73b116727c4156ce", + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "async": "^3.2.0", + "is": "^3.3.0", + "localforage": "^1.7.3", + "mkdirp": "^1.0.3", + "underscore": "^1.12.1" + } + }, + "node_modules/nedb-core/node_modules/mkdirp": { + "version": "1.0.4", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "dev": true, + "license": "MIT" + }, + "node_modules/nise": { + "version": "5.1.9", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/text-encoding": "^0.7.2", + "just-extend": "^6.2.0", + "path-to-regexp": "^6.2.1" + } + }, + "node_modules/nise/node_modules/@sinonjs/fake-timers": { + "version": "11.2.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/nise/node_modules/path-to-regexp": { + "version": "6.2.1", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-gyp": { + "version": "10.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^4.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/node-gyp/node_modules/abbrev": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/node-gyp/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/node-gyp/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/isexe": { + "version": "3.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/node-gyp/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "7.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/node-gyp/node_modules/which": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/node-machine-id": { + "version": "1.1.12", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.14", + "dev": true, + "license": "MIT" + }, + "node_modules/node-rsa": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "asn1": "^0.2.4" + } + }, + "node_modules/nodemon": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.3.tgz", + "integrity": "sha512-7jH/NXbFPxVaMwmBCC2B9F/V6X1VkEdNgx3iu9jji8WxWcvhMWkmhNWhI5077zknOnZnBzba9hZP6bCPJLSReQ==", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nodemon/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==" + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/nopt": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-bundled": { + "version": "1.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/npm-install-checks": { + "version": "6.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "dev": true, + "license": "ISC" + }, + "node_modules/npm-package-arg": { + "version": "8.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^3.0.6", + "semver": "^7.0.0", + "validate-npm-package-name": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-package-arg/node_modules/builtins": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-package-arg/node_modules/hosted-git-info": { + "version": "3.0.8", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-package-arg/node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { + "version": "3.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "builtins": "^1.0.3" + } + }, + "node_modules/npm-package-arg/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/npm-packlist": { + "version": "5.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^8.0.1", + "ignore-walk": "^5.0.1", + "npm-bundled": "^1.1.2", + "npm-normalize-package-bin": "^1.0.1" + }, + "bin": { + "npm-packlist": "bin/index.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-packlist/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-packlist/node_modules/glob": { + "version": "8.1.0", + "dev": true, + "license": "ISC", + "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/npm-packlist/node_modules/minimatch": { + "version": "5.1.6", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-pick-manifest": { + "version": "9.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^11.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-pick-manifest/node_modules/hosted-git-info": { + "version": "7.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-pick-manifest/node_modules/lru-cache": { + "version": "10.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-pick-manifest/node_modules/npm-package-arg": { + "version": "11.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch": { + "version": "14.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "make-fetch-happen": "^11.0.0", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^10.0.0", + "proc-log": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/cacache": { + "version": "17.1.4", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^7.7.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/cacache/node_modules/minipass": { + "version": "7.0.4", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/npm-registry-fetch/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/npm-registry-fetch/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm-registry-fetch/node_modules/hosted-git-info": { + "version": "6.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/http-proxy-agent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/npm-registry-fetch/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/npm-registry-fetch/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/npm-registry-fetch/node_modules/make-fetch-happen": { + "version": "11.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm-registry-fetch/node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-registry-fetch/node_modules/minipass-collect": { + "version": "1.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/npm-registry-fetch/node_modules/minipass-collect/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-registry-fetch/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-registry-fetch/node_modules/npm-package-arg": { + "version": "10.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/socks-proxy-agent": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/npm-registry-fetch/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/ssri/node_modules/minipass": { + "version": "7.0.4", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/npm-registry-fetch/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/npm-run-path": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npmlog": { + "version": "6.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/nx": { + "version": "18.0.4", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@nrwl/tao": "18.0.4", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "3.0.0-rc.46", + "@zkochan/js-yaml": "0.0.6", + "axios": "^1.6.0", + "chalk": "^4.1.0", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^8.0.1", + "dotenv": "~16.3.1", + "dotenv-expand": "~10.0.0", + "enquirer": "~2.3.6", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^11.1.0", + "ignore": "^5.0.4", + "jest-diff": "^29.4.1", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.0", + "lines-and-columns": "~2.0.3", + "minimatch": "9.0.3", + "node-machine-id": "1.1.12", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "ora": "5.3.0", + "semver": "^7.5.3", + "string-width": "^4.2.3", + "strong-log-transformer": "^2.1.0", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0", + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" + }, + "bin": { + "nx": "bin/nx.js", + "nx-cloud": "bin/nx-cloud.js" + }, + "optionalDependencies": { + "@nx/nx-darwin-arm64": "18.0.4", + "@nx/nx-darwin-x64": "18.0.4", + "@nx/nx-freebsd-x64": "18.0.4", + "@nx/nx-linux-arm-gnueabihf": "18.0.4", + "@nx/nx-linux-arm64-gnu": "18.0.4", + "@nx/nx-linux-arm64-musl": "18.0.4", + "@nx/nx-linux-x64-gnu": "18.0.4", + "@nx/nx-linux-x64-musl": "18.0.4", + "@nx/nx-win32-arm64-msvc": "18.0.4", + "@nx/nx-win32-x64-msvc": "18.0.4" + }, + "peerDependencies": { + "@swc-node/register": "^1.8.0", + "@swc/core": "^1.3.85" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "node_modules/nx/node_modules/@nx/nx-darwin-arm64": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-18.0.4.tgz", + "integrity": "sha512-9KJVONxUwdnFHHRNocsg7q5pliOTTfbjlr3rvhLuroV5HeTJFhUipKCQrVEhLy8e4auRdLuSz/HsgpJat3Z2cg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/nx/node_modules/@nx/nx-darwin-x64": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-18.0.4.tgz", + "integrity": "sha512-rFKHjeU0Ngz1R7UJAsbncpqwuFDjUdpcvI783r6s2eP7JoiiwtDBXvDcHiy8Odk0lPYmwDELaFZBhvdENqaDNA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/nx/node_modules/@nx/nx-linux-x64-gnu": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-18.0.4.tgz", + "integrity": "sha512-BVLkegIwxHnEB64VBraBxyC01D3C3dVNxq2b4iNaqr4mpWNmos+G/mvcTU3NS7W8ZjpBjlXgdEkpgkl2hMKTEA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/nx/node_modules/@nx/nx-linux-x64-musl": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-18.0.4.tgz", + "integrity": "sha512-WgVy41psjCE9uxjFi4P62UrWyKQ1e2IN2FZaIuwXEB9h8OU/+g9PFpL1Cs1llNoEKnapKXX4+9b5FHF9i7EKQw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/nx/node_modules/@nx/nx-win32-x64-msvc": { + "version": "18.0.4", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-18.0.4.tgz", + "integrity": "sha512-FdAdl5buvtUXp8hZVRkK0AZeiCu35l0u+yHsulNViYdh3OXRT1hYJ0CeqpxlLfvbHqB9JzDPtJtG0dpKHH/O0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/nx/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/nx/node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/nx/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/nx/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/nx/node_modules/cli-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/nx/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/nx/node_modules/dotenv": { + "version": "16.3.2", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/nx/node_modules/enquirer": { + "version": "2.3.6", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/nx/node_modules/ignore": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/nx/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/nx/node_modules/json5": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/nx/node_modules/lines-and-columns": { + "version": "2.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/nx/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nx/node_modules/npm-run-path": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nx/node_modules/ora": { + "version": "5.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "log-symbols": "^4.0.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nx/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/restore-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nx/node_modules/tsconfig-paths": { + "version": "4.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/oauth2-server": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "basic-auth": "1.1.0", + "bluebird": "3.5.0", + "lodash": "4.17.4", + "promisify-any": "2.0.1", + "statuses": "1.3.1", + "type-is": "1.6.15" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/oauth2-server/node_modules/basic-auth": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/oauth2-server/node_modules/bluebird": { + "version": "3.5.0", + "license": "MIT" + }, + "node_modules/oauth2-server/node_modules/lodash": { + "version": "4.17.4", + "license": "MIT" + }, + "node_modules/oauth2-server/node_modules/statuses": { + "version": "1.3.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/oauth2-server/node_modules/type-is": { + "version": "1.6.15", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.15" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "array.prototype.filter": "^1.0.3", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.0.0" + } + }, + "node_modules/object.values": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/onetime/node_modules/mimic-fn": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "8.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/ora/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/os-shim": { + "version": "0.1.3", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map-series": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/p-pipe": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue": { + "version": "6.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.4", + "p-timeout": "^3.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue/node_modules/eventemitter3": { + "version": "4.0.7", + "dev": true, + "license": "MIT" + }, + "node_modules/p-reduce": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/p-timeout": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/p-waterfall": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "p-reduce": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pacote": { + "version": "17.0.6", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^5.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^7.0.0", + "cacache": "^18.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^11.0.0", + "npm-packlist": "^8.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", + "proc-log": "^3.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^7.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^2.2.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "lib/bin.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/@sigstore/bundle": { + "version": "2.2.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/@sigstore/protobuf-specs": { + "version": "0.3.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/@sigstore/sign": { + "version": "2.2.3", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0", + "make-fetch-happen": "^13.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/@sigstore/tuf": { + "version": "2.3.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.0", + "tuf-js": "^2.2.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/@tufjs/canonical-json": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/@tufjs/models": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/pacote/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pacote/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/hosted-git-info": { + "version": "7.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/ignore-walk": { + "version": "6.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/lru-cache": { + "version": "10.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/pacote/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/pacote/node_modules/normalize-package-data": { + "version": "6.0.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/npm-package-arg": { + "version": "11.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/npm-packlist": { + "version": "8.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "ignore-walk": "^6.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/npm-registry-fetch": { + "version": "16.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "make-fetch-happen": "^13.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^11.0.0", + "proc-log": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/read-package-json": { + "version": "7.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/sigstore": { + "version": "2.2.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/sign": "^2.2.3", + "@sigstore/tuf": "^2.3.1", + "@sigstore/verify": "^1.1.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/tuf-js": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/models": "2.0.0", + "debug": "^4.3.4", + "make-fetch-happen": "^13.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-path": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "protocols": "^2.0.0" + } + }, + "node_modules/parse-url": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-path": "^7.0.0" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/particle-api-js": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/particle-api-js/-/particle-api-js-10.4.2.tgz", + "integrity": "sha512-YhG1KdMGrzC8sd8a3UQMM58XTMRTiX5ZzfRf25OJMvym4UIIPMWIFXLa/d1hQIaFqxomZjwqdu8HF7NMVMWK+Q==", + "dependencies": { + "form-data": "^4.0.0", + "node-fetch": "^2.7.0", + "qs": "^6.11.2", + "stream-http": "^3.2.0" + }, + "engines": { + "node": ">=12.x", + "npm": "8.x" + } + }, + "node_modules/particle-api-js/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/particle-api-js/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/particle-api-js/node_modules/qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/particle-api-js/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/particle-api-js/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/particle-api-js/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/particle-collider": { + "resolved": "packages/particle-collider", + "link": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.6.0", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pre-commit": { + "version": "1.2.2", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^5.0.1", + "spawn-sync": "^1.0.15", + "which": "1.2.x" + } + }, + "node_modules/pre-commit/node_modules/which": { + "version": "1.2.14", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/proc-log": { + "version": "3.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "license": "MIT" + }, + "node_modules/progress": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "dev": true, + "license": "ISC" + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/promisify-any": { + "version": "2.0.1", + "dependencies": { + "bluebird": "^2.10.0", + "co-bluebird": "^1.1.0", + "is-generator": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/promisify-any/node_modules/bluebird": { + "version": "2.11.0", + "license": "MIT" + }, + "node_modules/prompts": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/promzard": { + "version": "1.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "read": "^2.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/protocols": { + "version": "2.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "dev": true, + "license": "ISC" + }, + "node_modules/psl": { + "version": "1.9.0", + "license": "MIT" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "node_modules/punycode": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.0.4", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.11.0", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react-is": { + "version": "18.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/read": { + "version": "2.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "mute-stream": "~1.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-cmd-shim": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json": { + "version": "6.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json-fast": { + "version": "3.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json-fast/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/read-package-json/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/hosted-git-info": { + "version": "6.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/read-package-json/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/normalize-package-data": { + "version": "5.0.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up/node_modules/p-try": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "dev": true, + "license": "ISC" + }, + "node_modules/read-pkg/node_modules/load-json-file": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/parse-json": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/path-type": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/pify": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read/node_modules/mute-stream": { + "version": "1.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/readable-stream": { + "version": "1.1.14", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/readdir-glob": { + "version": "1.1.3", + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "5.1.6", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/request": { + "version": "2.88.2", + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.3.1", + "dev": true, + "license": "MIT" + }, + "node_modules/rimraf": { + "version": "5.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rmfr": { + "version": "2.0.0", + "license": "ISC", + "dependencies": { + "assert-valid-glob-opts": "^1.0.0", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "inspect-with-kind": "^1.0.4", + "rimraf": "^2.6.2" + } + }, + "node_modules/rmfr/node_modules/rimraf": { + "version": "2.7.1", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-json-stringify": { + "version": "1.2.0", + "license": "MIT", + "optional": true + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.6.0", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "license": "ISC" + }, + "node_modules/send": { + "version": "0.18.0", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.1", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "license": "ISC" + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/side-channel": { + "version": "1.0.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC" + }, + "node_modules/sigstore": { + "version": "1.9.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^1.1.0", + "@sigstore/protobuf-specs": "^0.2.0", + "@sigstore/sign": "^1.0.0", + "@sigstore/tuf": "^1.0.3", + "make-fetch-happen": "^11.0.1" + }, + "bin": { + "sigstore": "bin/sigstore.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/sigstore/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/sigstore/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/sigstore/node_modules/cacache": { + "version": "17.1.4", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^7.7.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/sigstore/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sigstore/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sigstore/node_modules/http-proxy-agent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/sigstore/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/sigstore/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/sigstore/node_modules/make-fetch-happen": { + "version": "11.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/sigstore/node_modules/make-fetch-happen/node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/sigstore/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sigstore/node_modules/minipass-collect": { + "version": "1.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/sigstore/node_modules/minipass-collect/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sigstore/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/sigstore/node_modules/socks-proxy-agent": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/sigstore/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/sigstore/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sinon": { + "version": "17.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/samsam": "^8.0.0", + "diff": "^5.1.0", + "nise": "^5.1.5", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon/node_modules/@sinonjs/fake-timers": { + "version": "11.2.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.3", + "devOptional": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/sort-keys": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-plain-obj": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "license": "MIT", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/spawn-sync": { + "version": "1.0.15", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.17", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/split": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/split2": { + "version": "3.2.2", + "dev": true, + "license": "ISC", + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/split2/node_modules/readable-stream": { + "version": "3.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/split2/node_modules/string_decoder": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/sshpk": { + "version": "1.18.0", + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "9.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ssri/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ssri/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-http": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", + "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + } + }, + "node_modules/stream-http/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/stream-http/node_modules/string_decoder": { + "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==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/stream-transform": { + "version": "3.3.0", + "license": "MIT" + }, + "node_modules/streamsearch": { + "version": "0.1.2", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "license": "MIT" + }, + "node_modules/string-argv": { + "version": "0.3.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width": { + "version": "7.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/emoji-regex": { + "version": "10.3.0", + "dev": true, + "license": "MIT" + }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strong-log-transformer": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "duplexer": "^0.1.1", + "minimist": "^1.2.0", + "through": "^2.3.4" + }, + "bin": { + "sl-log-transformer": "bin/sl-log-transformer.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/superagent": { + "version": "8.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.1.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + } + }, + "node_modules/superagent/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/superagent/node_modules/form-data": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/superagent/node_modules/mime": { + "version": "2.6.0", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/superagent/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/supertest": { + "version": "6.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^8.1.2" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color/node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/synckit": { + "version": "0.8.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/tar": { + "version": "6.1.11", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tar-stream/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/temp-dir": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-extensions": { + "version": "1.9.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/through": { + "version": "2.3.8", + "dev": true, + "license": "MIT" + }, + "node_modules/through2": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tmp": { + "version": "0.2.1", + "license": "MIT", + "dependencies": { + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" + } + }, + "node_modules/tmp-promise": { + "version": "3.0.3", + "license": "MIT", + "dependencies": { + "tmp": "^0.2.0" + } + }, + "node_modules/tmp/node_modules/rimraf": { + "version": "3.0.2", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/traverse": { + "version": "0.3.9", + "license": "MIT/X11" + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-api-utils": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-jest": { + "version": "29.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/json5": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "dev": true, + "license": "0BSD" + }, + "node_modules/tuf-js": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/models": "1.0.4", + "debug": "^4.3.4", + "make-fetch-happen": "^11.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tuf-js/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/tuf-js/node_modules/cacache": { + "version": "17.1.4", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^7.7.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/tuf-js/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tuf-js/node_modules/http-proxy-agent": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tuf-js/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tuf-js/node_modules/lru-cache": { + "version": "7.18.3", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/tuf-js/node_modules/make-fetch-happen": { + "version": "11.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/make-fetch-happen/node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/tuf-js/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tuf-js/node_modules/minipass-collect": { + "version": "1.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tuf-js/node_modules/minipass-collect/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tuf-js/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/tuf-js/node_modules/socks-proxy-agent": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/tuf-js/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "license": "Unlicense" + }, + "node_modules/type-check": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "license": "MIT" + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/uglifyjs": { + "version": "2.4.11", + "dev": true + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "node_modules/underscore": { + "version": "1.13.6", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "license": "MIT" + }, + "node_modules/unique-filename": { + "version": "3.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/unique-slug": { + "version": "4.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "dev": true, + "license": "ISC" + }, + "node_modules/universalify": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/unzipper": { + "version": "0.10.14", + "license": "MIT", + "dependencies": { + "big-integer": "^1.6.17", + "binary": "~0.3.0", + "bluebird": "~3.4.1", + "buffer-indexof-polyfill": "~1.0.0", + "duplexer2": "~0.1.4", + "fstream": "^1.0.12", + "graceful-fs": "^4.2.2", + "listenercount": "~1.0.1", + "readable-stream": "~2.3.6", + "setimmediate": "~1.0.4" + } + }, + "node_modules/unzipper/node_modules/bluebird": { + "version": "3.4.7", + "license": "MIT" + }, + "node_modules/unzipper/node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/unzipper/node_modules/readable-stream": { + "version": "2.3.8", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/unzipper/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" + }, + "node_modules/unzipper/node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/upath": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-glob-opts": { + "version": "1.0.2", + "license": "ISC", + "dependencies": { + "array-to-sentence": "^1.1.0", + "indexed-filter": "^1.0.0", + "inspect-with-kind": "^1.0.4", + "is-plain-obj": "^1.1.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/verror/node_modules/core-util-is": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/walker": { + "version": "1.0.8", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "13.0.0", + "license": "MIT", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/which": { + "version": "1.3.1", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.14", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wide-align/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wide-align/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wide-align/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wide-align/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/write-json-file": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.15", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.4.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/write-json-file/node_modules/make-dir": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/write-json-file/node_modules/pify": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/write-json-file/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/write-json-file/node_modules/write-file-atomic": { + "version": "2.4.3", + "dev": true, + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "node_modules/write-pkg": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "sort-keys": "^2.0.0", + "type-fest": "^0.4.1", + "write-json-file": "^3.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/write-pkg/node_modules/type-fest": { + "version": "0.4.1", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=6" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "2.1.2", + "dev": true, + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.3.4", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zip-stream": { + "version": "4.1.1", + "license": "MIT", + "dependencies": { + "archiver-utils": "^3.0.4", + "compress-commons": "^4.1.2", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/zip-stream/node_modules/archiver-utils": { + "version": "3.0.4", + "license": "MIT", + "dependencies": { + "glob": "^7.2.3", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/zip-stream/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/zip-stream/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "packages/particle-collider": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "chalk": "^4", + "coap-packet": "^1.1.1", + "node-rsa": "^1.1.1", + "nodemon": "^3.0.3", + "nullthrows": "^1.1.1", + "particle-api-js": "^10.4.2" + }, + "devDependencies": { + "ts-node": "^10.9.2", + "typescript": "^5.3.3" + } + }, + "packages/particle-collider/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "packages/particle-collider/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/particle-collider/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "packages/particle-collider/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "packages/spark-protocol": { + "name": "@brewskey/spark-protocol", + "version": "1.0.3", + "license": "LGPL-3.0", + "dependencies": { + "@particle/device-constants": "^3.3.1", + "binary-version-reader": "https://github.com/particle-iot/binary-version-reader", + "buffer-crc32": "~1.0.0", + "bunyan": "^1.8.15", + "chalk": "^5.3.0", + "coap-packet": "^1.1.1", + "constitute": "^1.6.2", + "dotenv": "^16.4.3", + "ec-key": "^0.0.4", + "hogan.js": "*", + "mkdirp": "^3.0.1", + "moment": "^2.30.1", + "moniker": "^0.1.2", + "node-rsa": "^1.1.1", + "nullthrows": "^1.1.1", + "promise-retry": "^2.0.1", + "request": "^2.83.0", + "uuid": "^9.0.1" + }, + "bin": { + "update-firmware": "dist/scripts/update-firmware-binaries.js" + }, + "devDependencies": { + "@octokit/rest": "^20.0.2", + "@types/buffer-crc32": "^0.2.4", + "@types/bunyan": "^1.8.11", + "@types/hogan.js": "^3.0.5", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.17", + "@types/node-rsa": "^1.1.4", + "@types/sinon": "^17.0.3", + "@types/uuid": "^9.0.8", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.2.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-prettier": "^5.1.3", + "jest": "^29.7.0", + "lint-staged": "^15.2.2", + "pre-commit": "^1.2.2", + "prettier": "^3.2.5", + "sinon": "^17.0.1", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", + "typescript": "^5.3.3" + } + }, + "packages/spark-protocol/node_modules/buffer-crc32": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + } + } +} diff --git a/package.json b/package.json index 4621da23..5d103faf 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,13 @@ { - "name": "spark-server", - "version": "0.1.1", + "name": "@brewskey/spark-server", + "version": "1.0.4", "license": "AGPL-3.0", "repository": { "type": "git", - "url": "https://github.com/spark/spark-server" - }, - "homepage": "https://github.com/spark/spark-server", - "bugs": "https://github.com/spark/spark-server/issues", - "author": { - "name": "David Middlecamp", - "email": "david@spark.io", - "url": "https://www.spark.io/" + "url": "https://github.com/brewskey/spark-server" }, + "homepage": "https://github.com/brewskey/spark-server", + "bugs": "https://github.com/brewskey/spark-server/issues", "contributors": [ { "name": "Kenneth Lim", @@ -23,86 +18,130 @@ "name": "Emily Rose", "email": "emily@spark.io", "url": "https://github.com/emilyrose" + }, + { + "name": "John Kalberer", + "email": "john@brewskey.com", + "url": "https://github.com/jlkalberer" } ], "main": "./dist/exports.js", + "files": [ + "dist" + ], "scripts": { - "build": "babel ./src --out-dir ./dist", - "build:watch": "babel ./src --out-dir ./dist --watch", + "build": "tsc", + "build:deps": "npx lerna run build", + "build:all": "npm run build:deps && npm run build", "build:clean": "rimraf ./build", - "lint": "eslint --fix --max-warnings 0 -- .", - "prebuild": "npm run build:clean", - "start": "nodemon --exec babel-node ./src/main.js --watch src --watch ../spark-protocol/dist --ignore data", - "start:prod": "npm run build && node ./build/main.js", - "test": "ava --serial", - "test:watch": "ava --watch --serial" + "build:watch": "tsc --watch src --watch ../spark-protocol/dist --ignore data", + "lint": "eslint --fix --max-warnings 0 ./src", + "lint-staged": "lint-staged", + "lint:deps": "npx lerna run lint", + "migrate-files-to-mongo": "ts-node ./src/scripts/migrateFilesToDatabase mongo", + "migrate-files-to-nedb": "ts-node ./src/scripts/migrateFilesToDatabase nedb", + "prettify": "prettier --write src/*/**.ts", + "prettify:deps": "npx lerna run prettify", + "start": "nodemon --watch \"src/**\" --ext \"ts,json\" --ignore \"src/**/*.test.ts\" --exec \"ts-node src/main.ts | bunyan\"", + "start:debug": "ts-node ./src/main.ts --watch src --ignore data | bunyan", + "start:prod": "node ./dist/main.js | bunyan", + "start:warn": "ts-node ./src/main.ts --trace-warnings | bunyan", + "test": "jest", + "test:deps": "npx lerna run test", + "test:all": "npm run test:deps && npm run test", + "test:watch": "jest --watch", + "watch": "tsc --watch", + "update-firmware": "node ./node_modules/spark-protocol/dist/scripts/update-firmware-binaries", + "bump": "npm update spark-protocol" }, - "pre-commit": [ - "lint", - "test" + "workspaces": [ + "packages/*" ], - "ava": { - "verbose": true, - "babel": "inherit", - "files": [ - "test/*.test.js", - "!test/__test_data__/*" + "lint-staged": { + "examples/**/*.js": [ + "npm run prettify" ], - "require": [ - "babel-register" + "src/**/*.ts": [ + "npm run lint", + "npm run prettify" ] }, + "pre-commit": [ + "build:all", + "lint:deps", + "prettify:deps", + "lint-staged", + "test:deps", + "test" + ], "dependencies": { - "array-flatten": "^2.1.1", - "babel-cli": "^6.22.2", - "babel-loader": "^6.2.10", - "babel-runtime": "^6.22.0", + "@brewskey/spark-protocol": "^1.0.0", "basic-auth-parser": "0.0.2", - "binary-version-reader": "^0.5.0", - "body-parser": "^1.15.2", + "binary-version-reader": "^2.4.0", + "body-parser": "^1.20.2", + "bunyan": "^1.8.15", + "bunyan-middleware": "^1.0.2", "constitute": "^1.6.2", - "express": "^4.14.0", - "express-oauth-server": "^2.0.0-b1", + "cors": "^2.8.5", + "csv": "^6.3.6", + "ec-key": "^0.0.4", + "express": "^4.18.2", + "express-oauth-server": "^2.0.0", "hogan.js": "^3.0.2", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "moment": "*", - "morgan": "^1.7.0", + "lodash": "^4.17.21", + "mkdirp": "^3.0.1", + "moment": "^2.30.1", + "mongodb": "^6.3.0", + "morgan": "^1.10.0", "multer": "^1.2.1", - "nullthrows": "^1.0.0", - "request": "*", - "rimraf": "^2.5.4", - "rmfr": "^1.0.1", - "spark-protocol": "git+https://github.com/Brewskey/spark-protocol.git#dev", - "ursa": "^0.9.4", - "uuid": "^3.0.1" + "nedb-core": "https://github.com/bnielsen1965/nedb-core", + "node-rsa": "^1.1.1", + "nullthrows": "^1.1.1", + "request": "^2.83.0", + "rmfr": "^2.0.0", + "uuid": "^9.0.1" }, "devDependencies": { - "ava": "^0.17.0", - "babel-eslint": "^7.1.1", - "babel-plugin-transform-class-properties": "^6.19.0", - "babel-plugin-transform-decorators": "^6.13.0", - "babel-plugin-transform-decorators-legacy": "^1.3.4", - "babel-plugin-transform-es2015-destructuring": "^6.19.0", - "babel-plugin-transform-es2015-spread": "^6.8.0", - "babel-plugin-transform-flow-strip-types": "^6.18.0", - "babel-plugin-transform-runtime": "^6.15.0", - "babel-preset-es2015": "^6.18.0", - "babel-preset-latest": "^6.16.0", - "babel-preset-stage-0": "^6.16.0", - "babel-preset-stage-1": "^6.16.0", - "babel-register": "^6.18.0", - "eslint": "^3.11.0", - "eslint-config-airbnb-base": "^10.0.1", - "eslint-plugin-flowtype": "^2.28.2", - "eslint-plugin-import": "^2.2.0", - "eslint-plugin-sorting": "^0.3.0", - "flow-bin": "^0.37.0", - "nodemon": "^1.11.0", + "@octokit/rest": "^20.0.2", + "@types/cors": "^2.8.17", + "@types/express-bunyan-logger": "^1.3.6", + "@types/express-oauth-server": "^2.0.7", + "@types/hogan.js": "^3.0.5", + "@types/jest": "^29.5.12", + "@types/lodash": "^4.14.202", + "@types/multer": "^1.4.11", + "@types/request": "^2.48.12", + "@types/rmfr": "^2.0.5", + "@types/sinon": "^17.0.3", + "@types/supertest": "^6.0.2", + "@types/uuid": "^9.0.8", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.2.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-prettier": "^5.1.3", + "jest": "^29.7.0", + "lerna": "^8.1.2", + "lint-staged": "^15.2.2", + "nodemon": "^3.0.3", "pre-commit": "^1.2.2", - "rimraf": "^2.5.4", - "sinon": "^1.17.7", - "supertest": "^2.0.1", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "sinon": "^17.0.1", + "supertest": "^6.3.4", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", + "typescript": "^5.3.3", "uglifyjs": "^2.4.10" + }, + "optionalDependencies": { + "@nx/nx-darwin-arm64": "16.8.1", + "@nx/nx-darwin-x64": "16.8.1", + "@nx/nx-linux-x64-gnu": "16.8.1", + "@nx/nx-linux-x64-musl": "16.8.1", + "@nx/nx-win32-x64-msvc": "16.8.1" } } diff --git a/packages/particle-collider/.eslintignore b/packages/particle-collider/.eslintignore new file mode 100644 index 00000000..5c7f5de5 --- /dev/null +++ b/packages/particle-collider/.eslintignore @@ -0,0 +1,13 @@ +packages + +# Don't check auto-generated stuff +coverage +build +dist +binaries +node_modules + +# Cruft +.DS_Store +npm-debug.log +.idea diff --git a/packages/particle-collider/.eslintrc b/packages/particle-collider/.eslintrc new file mode 100644 index 00000000..2b3a919a --- /dev/null +++ b/packages/particle-collider/.eslintrc @@ -0,0 +1,69 @@ +{ + "root": true, + "parserOptions": { + "project": "./tsconfig.json", + }, + "plugins": ["@typescript-eslint", "import", "prettier"], + "extends": [ + "airbnb-typescript/base", + "prettier", + "plugin:@typescript-eslint/recommended", + "plugin:import/typescript", + ], + "parser": "@typescript-eslint/parser", + "rules": { + "eol-last": 2, + "import/first": 0, + "import/newline-after-import": 0, + "import/no-duplicates": 0, + "import/no-extraneous-dependencies": 0, + "import/no-named-as-default": 0, + "import/no-unresolved": 2, + "import/prefer-default-export": 0, + "newline-per-chained-call": 0, + "no-confusing-arrow": 0, + "no-console": 0, + "no-duplicate-imports": 0, + "no-mixed-operators": 0, + "no-underscore-dangle": 0, + "no-use-before-define": 0, + "class-methods-use-this": "off", + "no-promise-executor-return": "off", + "quotes": [ + 2, + "single", + { + "avoidEscape": true, + }, + ], + "semi": 2, + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", // or "error" + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + }, + ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": ["parameter", "variable"], + "leadingUnderscore": "forbid", + "filter": { + // keep this one open for destructuring + "regex": "_*", + "match": false, + }, + "format": null, + }, + { + "selector": "parameter", + "leadingUnderscore": "require", + "format": null, + "modifiers": ["unused"], + }, + ], + }, +} diff --git a/packages/particle-collider/.gitignore b/packages/particle-collider/.gitignore new file mode 100644 index 00000000..fe609ddf --- /dev/null +++ b/packages/particle-collider/.gitignore @@ -0,0 +1,60 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +/data \ No newline at end of file diff --git a/packages/particle-collider/.prettierrc b/packages/particle-collider/.prettierrc new file mode 100644 index 00000000..bbee69b7 --- /dev/null +++ b/packages/particle-collider/.prettierrc @@ -0,0 +1,6 @@ +{ + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "trailingComma": "all" +} \ No newline at end of file diff --git a/packages/particle-collider/LICENSE b/packages/particle-collider/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/packages/particle-collider/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. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +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: + + {project} Copyright (C) {year} {fullname} + 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 +. diff --git a/packages/particle-collider/README.md b/packages/particle-collider/README.md new file mode 100644 index 00000000..85ac7886 --- /dev/null +++ b/packages/particle-collider/README.md @@ -0,0 +1,20 @@ +
+    ____             __  _      __        ______      _____     __         
+   / __ \____ ______/ /_(_)____/ /__     / ____/___  / / (_)___/ /__  _____
+  / /_/ / __ `/ ___/ __/ / ___/ / _ \   / /   / __ \/ / / / __  / _ \/ ___/
+ / ____/ /_/ / /  / /_/ / /__/ /  __/  / /___/ /_/ / / / / /_/ /  __/ /    
+/_/    \__,_/_/   \__/_/\___/_/\___/   \____/\____/_/_/_/\__,_/\___/_/      
+
+ +This is a stress testing framework for the local cloud (spark-server). It is +a great way to test the stability of your server or cluster of servers. + +Features: +* Generate virtual devices - These will register their public keys on your +server and get claimed under a test account. +* Call functions/variables on virtual devices - This will randomly send off +to your cloud which will communicate with your devices. +* Call webhooks on virtual devices - This will randomly call webhooks from the +virtual devices which will hit your cloud. +* Chaos-Monkey - Randomly run webhooks/functions/variables and continuously add +and remove devices. Use this to really give your server a thrashing. diff --git a/packages/particle-collider/jest.config.js b/packages/particle-collider/jest.config.js new file mode 100644 index 00000000..743b3bb2 --- /dev/null +++ b/packages/particle-collider/jest.config.js @@ -0,0 +1,8 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/**/*.test.ts'], + setupFilesAfterEnv: ['/src/setup-jest.ts'], + openHandlesTimeout: 1000, +}; diff --git a/packages/particle-collider/package.json b/packages/particle-collider/package.json new file mode 100644 index 00000000..dce851c4 --- /dev/null +++ b/packages/particle-collider/package.json @@ -0,0 +1,31 @@ +{ + "name": "@brewskey/particle-collider", + "version": "1.0.0", + "description": "spark-server stress tester", + "main": "index.js", + "scripts": { + "start": "ts-node ./src/index.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Brewskey/particle-collider.git" + }, + "author": "Brewskey", + "license": "ISC", + "bugs": { + "url": "https://github.com/Brewskey/particle-collider/issues" + }, + "homepage": "https://github.com/Brewskey/particle-collider#readme", + "dependencies": { + "chalk": "^4", + "coap-packet": "^1.1.1", + "node-rsa": "^1.1.1", + "nodemon": "^3.0.3", + "nullthrows": "^1.1.1", + "particle-api-js": "^10.4.2" + }, + "devDependencies": { + "ts-node": "^10.9.2", + "typescript": "^5.3.3" + } +} diff --git a/packages/particle-collider/src/App.ts b/packages/particle-collider/src/App.ts new file mode 100644 index 00000000..20371567 --- /dev/null +++ b/packages/particle-collider/src/App.ts @@ -0,0 +1,586 @@ +import chalk from 'chalk'; +import fs from 'fs'; +import nullthrows from 'nullthrows'; +import Particle from 'particle-api-js'; +import readline from 'readline'; +import testWebhook from './test-webhook.json'; +import path from 'path'; + +import CryptoManager from './lib/CryptoManager'; +import TCPDevice from './devices/TCPDevice'; + +type ReadlineInterface = { + close: () => void; + question: (question: string, callback: (answer: string) => void) => void; +}; + +type ConfigData = { + configs: Array; + defaultConfigIndex: number; +}; + +type Config = { + serverKeyPath: string; + serverPort: number; + serverUrl: string; +}; + +const USERNAME = '__test__@testaccount.com'; +const PASSWORD = 'password'; +const PARTICLE_API_CONFIG = { + clientId: 'particle-collider', + clientSecret: 'particle-collider', +}; + +const FOLDER_PATH = path.join(process.cwd(), 'data/'); +const CONFIG_FILE_PATH = path.join(FOLDER_PATH, 'configs.json'); + +const formatOption = ( + key: string | number, + description: string, + strikeThrough?: number | boolean, +) => { + if (strikeThrough) { + return; + } + + console.log(`${chalk.bgYellow.black(key)} ${description}`); +}; + +class App { + _accessToken!: string; + _configData!: ConfigData; + _devices: Array = []; + _existingDeviceIDs: Array = []; + _exit: boolean = false; + _functionInterval!: NodeJS.Timeout | null; + _particle!: Particle; + _rl: ReadlineInterface; + _variableInterval!: NodeJS.Timeout | null; + _webhookInterval!: NodeJS.Timeout | null; + + constructor() { + console.log( + ' ____ __ _ __ ______ _____ __ \n / __ \\____ ______/ /_(_)____/ /__ / ____/___ / / (_)___/ /__ _____\n / /_/ / __ `/ ___/ __/ / ___/ / _ \\ / / / __ \\/ / / / __ / _ \\/ ___/\n / ____/ /_/ / / / /_/ / /__/ / __/ / /___/ /_/ / / / / /_/ / __/ / \n/_/ \\__,_/_/ \\__/_/\\___/_/\\___/ \\____/\\____/_/_/_/\\__,_/\\___/_/ \n \n', + ); + + this._rl = readline.createInterface({ input: process.stdin }); + } + + run = async (): Promise => { + this._setupData(); + + let config = this._getConfig(); + if (!config) { + config = await this._setupNewConfig(); + } + try { + await this._setup(config); + } catch (error) { + console.error(error); + console.log(); + console.log(); + config = await this._setupNewConfig(); + await this._setup(config); + } + while (!this._exit) { + const connectedDeviceCount = this._devices.filter((device) => + device.getIsConnected(), + ).length; + console.log(''); + console.log( + chalk.green( + `${connectedDeviceCount} of ${this._devices.length} virtual ` + + `devices currently connected`, + ), + ); + console.log(chalk.green(`${this._existingDeviceIDs.length} claimed`)); + + this._renderMenu(); + + const answer = await this._question(); + switch (answer) { + case '1': { + await this._createDevices(config); + break; + } + + case '2': { + await this._stopDevices(); + break; + } + + case '3': { + await this._setDefaultConfig(); + config = nullthrows(this._getConfig()); + await this._setup(config); + break; + } + + case '4': { + config = await this._setupNewConfig(); + break; + } + + case '5': { + await this._callFunctions(); + break; + } + + case '6': { + await this._callVariables(); + break; + } + + case '7': { + await this._callWebhooks(); + break; + } + + case '8': { + await this._chaosMonkey(); + break; + } + + case 's': { + this._clearIntervals(); + + break; + } + + case 'e': { + await this._stopDevices(); + this._clearIntervals(); + this._exit = true; + break; + } + } + } + + this._rl.close(); + }; + + _clearIntervals = (): void => { + if (this._functionInterval != null) { + clearInterval(this._functionInterval); + } + if (this._variableInterval != null) { + clearInterval(this._variableInterval); + } + if (this._webhookInterval != null) { + clearInterval(this._webhookInterval); + } + this._functionInterval = null; + this._variableInterval = null; + this._webhookInterval = null; + }; + + _setup = async (config: Config): Promise => { + this._setServerKey(config); + await this._login(config); + await this._setupWebhooks(config); + + this._existingDeviceIDs = fs + .readdirSync(path.join(process.cwd(), `data/keys`)) + .map((file) => path.parse(file).name); + }; + + _renderMenu(): void { + console.log(''); + console.log('Choose an option:'); + formatOption(1, 'Start Virtual Device(s)'); + formatOption(2, 'Stop Virtual Device(s)'); + formatOption(3, 'Set default config'); + formatOption(4, 'Create new config'); + formatOption( + 5, + 'Call random device functions', + this._functionInterval != null, + ); + formatOption( + 6, + 'Get random device variables', + this._variableInterval != null, + ); + formatOption(7, 'Call random webhooks', this._webhookInterval != null); + formatOption( + 8, + 'Chaos-Monkey -- run all the things!', + this._functionInterval != null && + this._variableInterval != null && + this._webhookInterval != null, + ); + + if ( + this._functionInterval || + this._variableInterval || + this._webhookInterval + ) { + formatOption('s', 'Stop random calls'); + } + + formatOption('e', 'Exit'); + console.log(''); + } + + _setupNewConfig = async (): Promise => { + const config: Config = { + serverKeyPath: '', + serverPort: 8080, + serverUrl: '', + }; + + const getServerKey = async (): Promise => { + console.log( + 'In order to connect the virtual Particle devices, we need the ' + + 'public key to your local cloud server. What is the relative or ' + + 'absolute path to your server key?\r\n\r\nIt looks like ' + + 'server-key.pub.pem\r\n', + ); + const serverKeyPath = await this._question(); + + if (!fs.existsSync(serverKeyPath)) { + console.log(`Could not find the server key at ${serverKeyPath}`); + await getServerKey(); + return; + } + + config.serverKeyPath = serverKeyPath; + }; + + const getServerUrl = async (): Promise => { + console.log('Now we need the host name or IP address of your server.'); + console.log( + 'It can look like 192.168.0.175 or https://cloud.particle.io', + ); + const serverUrl = await this._question(); + config.serverUrl = serverUrl; + }; + + const getServerPort = async (): Promise => { + console.log('What is your server port? Default is 8080'); + const port = await this._question(); + + if (port && isNaN(Number(port))) { + await getServerPort(); + } + + config.serverPort = port ? parseInt(port, 10) : config.serverPort; + }; + + await getServerKey(); + await getServerUrl(); + await getServerPort(); + + console.log('Your server config has been correctly set.'); + + this._configData.configs.push(config); + this._configData.defaultConfigIndex = this._configData.configs.length - 1; + + fs.writeFileSync(CONFIG_FILE_PATH, JSON.stringify(this._configData)); + + await this._setup(config); + + return config; + }; + + _setDefaultConfig = async (): Promise => { + console.log('Pick a default config'); + const configs = this._configData.configs; + configs.map((config, index) => + console.log(`${chalk.green(index + 1)} ${config.serverUrl}`), + ); + const answer = await this._question(); + if (!answer) { + return; + } + + if (isNaN(Number(answer))) { + console.log('Input must be a number'); + await this._setDefaultConfig(); + return; + } + + const configIndex = parseInt(answer, 10) - 1; + if (configIndex < 0 || configIndex >= configs.length) { + console.log('Not a valid config.'); + await this._setDefaultConfig(); + return; + } + + if (this._configData.defaultConfigIndex !== configIndex) { + this._killDevices(this._devices.length); + } + + this._configData.defaultConfigIndex = configIndex; + this._saveConfig(); + }; + + _createDevices = async (config: Config): Promise => { + console.log('How many devices do you want to create?'); + const amountString = await this._question(); + + if (isNaN(Number(amountString))) { + return; + } + + const amount = parseInt(amountString, 10); + for (let ii = 0; ii < amount; ii++) { + const index = this._devices.length; + let deviceID = + this._existingDeviceIDs.length > index + ? this._existingDeviceIDs[index] + : null; + + if ( + deviceID && + !fs.existsSync(path.join(process.cwd(), `data/keys/${deviceID}.pem`)) + ) { + this._existingDeviceIDs.splice(ii, 1); + deviceID = null; + } + + const device = new TCPDevice({ + deviceID, + // Simulate devices that take longer to send data + networkDelay: Math.floor(Math.random() * 1000), + serverAddress: config.serverUrl, + }); + + // If the device doesn't already exist, we need to send the key and + // claim the device. + if (!deviceID) { + deviceID = device.getDeviceID(); + this._existingDeviceIDs.push(deviceID); + await this._particle.sendPublicKey({ + auth: this._accessToken, + deviceId: deviceID, + key: device.getPublicKey(), + }); + } + + console.log(`Adding ${this._devices.length}: ${deviceID}`); + this._devices.push(device); + } + + this._devices + .filter((device) => !device.getIsConnected()) + .map((device) => device.connect()); + + console.time('Time To Connect Devices'); + new Promise((resolve: (_: void) => void) => + setInterval(() => { + if (this._devices.every((device) => device.getIsConnected())) { + resolve(); + } + }), + ).then(() => console.timeEnd('Time To Connect Devices')); + }; + + _stopDevices = async (): Promise => { + console.log('How many devices do you want to stop?'); + const amountString = await this._question(); + + if (isNaN(Number(amountString))) { + return; + } + + let amount = parseInt(amountString, 10); + this._killDevices(amount); + }; + + _killDevices(amount: number): void { + const idsToAdd = []; + while (amount) { + amount -= 1; + const index = Math.floor(Math.random() * this._devices.length); + const device = this._devices[index]; + if (!device) { + continue; + } + const deviceID = device.getDeviceID(); + this._devices = this._devices.filter( + (device) => device.getDeviceID() !== deviceID, + ); + idsToAdd.push(deviceID); + this._existingDeviceIDs = this._existingDeviceIDs.filter( + (id) => id !== deviceID, + ); + + device.disconnect(); + } + + console.log(this._devices.length); + + this._existingDeviceIDs = this._existingDeviceIDs.concat(idsToAdd); + } + + _login = async (config: Config): Promise => { + this._particle = new Particle({ + ...PARTICLE_API_CONFIG, + baseUrl: config.serverUrl + `:${config.serverPort}`, + }); + + const credentials = { + password: PASSWORD, + username: USERNAME, + }; + const login = () => this._particle.login(credentials); + let loginData = null; + try { + loginData = await login(); + } catch (error) {} + + if (!loginData) { + await this._particle.createUser(credentials); + loginData = await login(); + } + + this._accessToken = loginData.body.access_token; + }; + + // Runs server actions with 10% of devices + _runServerAction( + callback: (device: TCPDevice) => void, + ): NodeJS.Timeout | null { + if (!this._devices.length) { + console.log(); + console.log(chalk.red("You don't have any devices running. Start some")); + return null; + } + + const INTERVAL = 5000; + const callAction = () => { + let devices = this._devices.filter((device) => device.getIsConnected()); + devices = devices.slice(0, Math.ceil(devices.length * 0.1)); + devices.forEach((device) => + setTimeout(() => callback(device), Math.random() * INTERVAL), + ); + }; + + callAction(); + return setInterval(callAction, INTERVAL); + } + + _callFunctions = async (): Promise => { + if (this._functionInterval) { + return; + } + + this._functionInterval = this._runServerAction((device) => + this._particle.callFunction({ + auth: this._accessToken, + deviceId: device.getDeviceID(), + name: 'testFn', + argument: Math.random(), + }), + ); + }; + + _callVariables = async (): Promise => { + if (this._variableInterval) { + return; + } + + this._variableInterval = this._runServerAction((device) => + this._particle.getVariable({ + auth: this._accessToken, + deviceId: device.getDeviceID(), + name: 'testVar', + }), + ); + }; + + _callWebhooks = async (): Promise => { + if (this._webhookInterval) { + return; + } + + this._webhookInterval = this._runServerAction((device) => + device.sendWebhook(), + ); + }; + + _chaosMonkey = async (): Promise => { + this._callFunctions(); + this._callVariables(); + this._callWebhooks(); + }; + + _setupWebhooks = async (config: Config): Promise => { + const webhooks = await this._particle.listWebhooks({ + auth: this._accessToken, + }); + if (webhooks && webhooks.body.length) { + const promises = webhooks.body.map((webhook) => + this._particle.deleteWebhook({ + auth: this._accessToken, + hookId: webhook.id, + }), + ); + await Promise.all(promises); + } + + let pingUrl = config.serverUrl.replace(/(^\w+:|^)\/\//, ''); + + await this._particle.createWebhook({ + ...testWebhook, + auth: this._accessToken, + url: `${config.serverPort === 443 ? 'https' : 'http'}://${pingUrl}:${config.serverPort}/v1/ping1`, + }); + }; + + _question = async (): Promise => { + return new Promise((resolve, reject) => { + this._rl.question('', (answer) => resolve(answer)); + }); + }; + + _setupData(): void { + if (!fs.existsSync(FOLDER_PATH)) { + fs.mkdirSync(FOLDER_PATH); + } + + if (!fs.existsSync(`${FOLDER_PATH}/keys`)) { + fs.mkdirSync(`${FOLDER_PATH}/keys`); + } + + if (!fs.existsSync(CONFIG_FILE_PATH)) { + this._configData = { + configs: [ + { + serverKeyPath: '../../../data/default_key.pub.pem', + serverPort: 8080, + serverUrl: 'http://localhost', + }, + ], + defaultConfigIndex: 0, + }; + this._saveConfig(); + } else { + this._configData = JSON.parse(fs.readFileSync(CONFIG_FILE_PATH, 'utf8')); + } + } + + _getConfig(): Config | null { + const { configs, defaultConfigIndex } = this._configData; + if (defaultConfigIndex === -1 || defaultConfigIndex >= configs.length) { + return null; + } + return configs[defaultConfigIndex]; + } + + _setServerKey(config: Config): void { + const keyString = fs.readFileSync( + path.join(FOLDER_PATH, config.serverKeyPath), + 'utf8', + ); + CryptoManager.setServerKey(keyString); + } + + _saveConfig(): void { + fs.writeFileSync(CONFIG_FILE_PATH, JSON.stringify(this._configData)); + } +} + +export default App; diff --git a/packages/particle-collider/src/devices/TCPDevice.ts b/packages/particle-collider/src/devices/TCPDevice.ts new file mode 100644 index 00000000..3d75fc02 --- /dev/null +++ b/packages/particle-collider/src/devices/TCPDevice.ts @@ -0,0 +1,588 @@ +import CoapPacket, { ParsedPacket } from 'coap-packet'; +import EventEmitter from 'events'; +import fs from 'fs'; +import { Socket } from 'net'; +import NodeRSA from 'node-rsa'; +import path from 'path'; + +import ChunkingStream from '../lib/ChunkingStream'; +import CoapUriType from '../lib/CoapUriType'; +import CryptoManager from '../lib/CryptoManager'; +import CryptoStream from '../lib/CryptoStream'; +import NetworkThrottleStream from '../lib/NetworkThrottleStream'; +import testWebhook from '../test-webhook.json'; + +const DEVICE_KEY_LENGTH = 12; +const COUNTER_MAX = 65536; +const RESPONSE_TIMEOUT = 10000; + +// TODO - Fill in real values here. We can just use whatever is in the photon. +const PRODUCT_ID = 0; +const PRODUCT_FIRMWARE_VERSION = 0; +const PLATFORM_ID = 0; +const COAP_VERSION = 1; + +const DESCRIBE_APPLICATION = 1 << 1; +const DESCRIBE_SYSTEM = 1 << 0; +const DESCRIBE_ALL = DESCRIBE_APPLICATION | DESCRIBE_SYSTEM; + +type DeviceState = 'next' | 'nonce' | 'set-session-key'; + +type TCPDeviceOptions = { + deviceID: string | null | undefined; + networkDelay: number; + serverAddress: string; +}; + +class TCPDevice { + _cipherStream!: CryptoStream; + _decipherStream!: CryptoStream; + _deviceID: Buffer; + _eventEmitter: EventEmitter = new EventEmitter(); + _helloTimeout: NodeJS.Timeout | null = null; + _isConnected: boolean = false; + _isConnecting: boolean = false; + _messageID: number = 0; + _networkDelay: number; + _pingInterval: NodeJS.Timeout | null = null; + _port: number; + _privateKey: NodeRSA; + _serverAddress: string; + _serverKey: NodeRSA; + _socket!: Socket; + _state: DeviceState; + _token!: Buffer; + + constructor({ deviceID, networkDelay, serverAddress }: TCPDeviceOptions) { + this._state = 'nonce'; + this._port = 5683; + this._networkDelay = networkDelay; + this._serverAddress = serverAddress; + this._serverKey = CryptoManager.getServerKey(); + + const index = serverAddress.indexOf('://'); + if (index >= 0) { + this._serverAddress = serverAddress.substr(index + 3); + } + + if (!deviceID) { + // Generate random device key + deviceID = CryptoManager.randomBytes(DEVICE_KEY_LENGTH) + .toString('hex') + .toLowerCase(); + const privateKey = CryptoManager.createKey(); + fs.writeFileSync( + path.join(process.cwd(), `data/keys/${deviceID}.pem`), + privateKey.exportKey('pkcs1-private-pem'), + ); + } + + this._privateKey = CryptoManager.loadPrivateKey( + fs.readFileSync( + path.join(process.cwd(), `data/keys/${deviceID}.pem`), + 'utf8', + ), + ); + this._deviceID = Buffer.from(deviceID, 'hex'); + } + + connect(): void { + if (this._isConnecting) { + return; + } + this._isConnecting = true; + this._socket = new Socket(); + + this._socket.connect({ + host: this._serverAddress, + port: this._port, + }); + this._socket.setTimeout(31000); + + this._socket.on('data', this._onReadData); + + this._socket.on('error', (error: Error) => this._reconnect(error)); + this._socket.on('close', () => this._reconnect(new Error('Socket close'))); + this._socket.on('timeout', () => + this._reconnect(new Error('Socket timeout')), + ); + } + + getDeviceID(): string { + return this._deviceID.toString('hex').toLowerCase(); + } + + getPublicKey(): string { + return this._privateKey.exportKey('pkcs8-public-pem'); + } + + getIsConnected(): boolean { + return this._isConnected; + } + + sendWebhook = (): void => { + this._sendEvent( + testWebhook.event, + Buffer.from(`{"payload": "${Math.random()}"}`), + ); + }; + + on = (event: string, callback: (arg1: TValue) => void) => + this._eventEmitter.on(event, callback); + + removeEventListener = ( + event: string, + callback: (arg1: TValue) => void, + ) => this._eventEmitter.removeListener(event, callback); + + disconnect = (): void => { + this._disconnect(); + this._isConnected = false; + }; + + _disconnect = (): void => { + if (!this._isConnected) { + return; + } + + this._isConnecting = false; + this._isConnected = false; + this._state = 'nonce'; + if (this._decipherStream) { + this._decipherStream.removeAllListeners(); + } + + this._socket.removeAllListeners(); + if (!this._socket.destroyed) { + this._socket.destroy(); + this._socket.on('error', () => {}); + } + + if (this._pingInterval) { + clearInterval(this._pingInterval); + this._pingInterval = null; + } + }; + + _reconnect = (error: Error): void => { + if (error) { + console.error(error); + } + if (!this._isConnected) { + return; + } + + this._disconnect(); + setTimeout(() => this.connect(), 15000); + }; + + _sleep = async (time = 100): Promise => + new Promise((resolve) => setTimeout(resolve, time)); + + _onReadData = async (data: Buffer): Promise => { + await this._sleep(); + switch (this._state) { + case 'nonce': { + const payload = this._prepareDevicePublicKey(data); + if (!this._socket.destroyed) { + this._socket.write(this._serverKey.encrypt(payload)); + } + this._state = 'set-session-key'; + break; + } + + case 'set-session-key': { + const cipherText = data.slice(0, 128); + const signedHMAC = data.slice(128); + + const sessionKey = this._privateKey.decrypt(cipherText); + // Server creates a 20-byte HMAC of the ciphertext using SHA1 and the 40 + // bytes generated in the previous step as the HMAC key. + const hash = CryptoManager.createHmacDigest(cipherText, sessionKey); + + const decryptedHMAC = this._serverKey.decryptPublic(signedHMAC); + + if (hash.compare(decryptedHMAC) === -1) { + throw new Error('HMAC did not match'); + } + + // The random session key has everything we need to create the crypto + // streams + const key = sessionKey.slice(0, 16); + const iv = sessionKey.slice(16, 32); + const salt = sessionKey.slice(32); // not sure what this is for... + + this._messageID = (sessionKey[32] << 8) | sessionKey[33]; + this._token = sessionKey.slice(34); + + // Create the crypto streams + this._decipherStream = new CryptoStream({ + iv, + key, + streamType: 'decrypt', + }); + this._cipherStream = new CryptoStream({ + iv, + key, + streamType: 'encrypt', + }); + + const chunkingIn = new ChunkingStream({ outgoing: false }); + const chunkingOut = new ChunkingStream({ outgoing: true }); + + const inputDelayStream = new NetworkThrottleStream(this._networkDelay); + const outputDelayStream = new NetworkThrottleStream(this._networkDelay); + + // What I receive gets broken into message chunks, and goes into the + // decrypter + this._socket + .pipe(inputDelayStream) + .pipe(chunkingIn) + .pipe(this._decipherStream); + + // What I send goes into the encrypter, and then gets broken into message + // chunks + this._cipherStream + .pipe(outputDelayStream) + .pipe(chunkingOut) + .pipe(this._socket); + + this._socket.removeListener('data', this._onReadData); + this._decipherStream.on('data', this._onNewCoapMessage); + + this._sendHello(); + + this._helloTimeout = setTimeout(() => { + throw new Error('Did not get hello response in 2 seconds'); + }, 3000); + + this._state = 'next'; + + // Ping every 10 seconds + this._pingInterval = setInterval(() => this._pingServer(), 15000); + this._isConnected = true; + + break; + } + + default: { + console.log('do the next thing', data); + } + } + }; + + _onNewCoapMessage = async (data: Buffer): Promise => { + const packet = CoapPacket.parse(data); + if (packet.code === '0.00' && packet.ack) { + this._eventEmitter.emit('ACK', packet); + } + + const uriOption = packet.options.find( + (option) => option.name === 'Uri-Path', + ); + if (!uriOption) { + return; + } + const path = uriOption.value.toString('utf8'); + const messageType = path.substring(0, path.indexOf('/')) || path; + const payload = packet.payload; + switch (messageType) { + case CoapUriType.Describe: { + let descriptionFlags = DESCRIBE_ALL; + if (payload.length > 8 && payload[8] <= DESCRIBE_ALL) { + descriptionFlags = payload[8]; + } else if (payload.length > 8) { + console.error(`Invalid DESCRIBE flags ${payload[8]}`); + } + + this._sendDescribe(descriptionFlags, packet); + + // Fully set up - we can register webhooks + await this._subscribeWebhooks(); + + break; + } + + case CoapUriType.Function: { + this._sendFunctionResult(packet); + break; + } + + case CoapUriType.Hello: { + // spark-server says hi + if (this._helloTimeout) { + clearTimeout(this._helloTimeout); + } + this._helloTimeout = null; + break; + } + + case CoapUriType.PrivateEvent: + case CoapUriType.PublicEvent: { + const uris = packet.options + .filter((o) => o.name === 'Uri-Path') + .map((o) => o.value.toString('utf8')); + uris.shift(); // Remove E or e + uris.pop(); // Remove index of the packet 0-X in the data buffer + this._eventEmitter.emit(uris.join('/'), packet); + break; + } + + case CoapUriType.Variable: { + this._sendVariable(packet); + break; + } + + default: { + console.warn(`Coap URI ${path} is not supported: ${packet}`); + } + } + }; + + _prepareDevicePublicKey(nonce: Buffer): Buffer { + // Concat a bunch of data that we will send over encrypted with the + // server public key. + return Buffer.concat([ + nonce, + this._deviceID, + this._privateKey.exportKey('pkcs8-public-der'), + ]); + } + + _nextMessageID(): number { + this._messageID += 1; + if (this._messageID >= COUNTER_MAX) { + this._messageID = 0; + } + + return this._messageID; + } + + _coapMessageHeader(type: number, tokenLength: number) { + return (COAP_VERSION << 6) | (type << 4) | (tokenLength & 0xf); + } + + _sendHello(): void { + const data = [ + PRODUCT_ID >> 8, + PRODUCT_ID & 0xff, + PRODUCT_FIRMWARE_VERSION >> 8, + PRODUCT_FIRMWARE_VERSION & 0xff, + 0, // Reserved flag + 0, // Flags -- newly upgraded. We probably won't use this + PLATFORM_ID >> 8, + PLATFORM_ID & 0xff, + this._deviceID.length >> 8, + this._deviceID.length & 0xff, + ]; + this._deviceID.forEach((bit) => data.push(bit)); + + const packet = CoapPacket.generate({ + code: 'POST', + messageId: this._nextMessageID(), + options: [ + { + name: 'Uri-Path', + value: Buffer.from('h'), + }, + ], + payload: Buffer.from(data), + }); + + this._writeData(packet); + } + + _sendDescribe(descriptionFlags: number, serverPacket: ParsedPacket): void { + // TODO: make this a bit more fancy + + const description = JSON.stringify({ + f: ['testfn'], + v: { testVar: 'INT' }, + // Copypasta'd from a real device + p: 6, + m: [ + { s: 16384, l: 'm', vc: 30, vv: 30, f: 'b', n: '0', v: 11, d: [] }, + { s: 262144, l: 'm', vc: 30, vv: 30, f: 's', n: '1', v: 105, d: [] }, + { + s: 262144, + l: 'm', + vc: 30, + vv: 30, + f: 's', + n: '2', + v: 105, + d: [{ f: 's', n: '1', v: 105, _: '' }], + }, + { + s: 131072, + l: 'm', + vc: 30, + vv: 30, + u: '2BA4E71E840F596B812003882AAE7CA6496F1590CA4A049310AF76EAF11C943A', + f: 'u', + n: '1', + v: 2, + d: [{ f: 's', n: '2', v: 1, _: '' }], + }, + { s: 131072, l: 'f', vc: 30, vv: 0, d: [] }, + ], + }); + + const packet = CoapPacket.generate({ + code: '2.05', // Content + messageId: this._nextMessageID(), + payload: Buffer.from(description), + token: serverPacket.token, + }); + + this._writeData(packet); + } + + _pingServer(): void { + if (!this._isConnected) { + return; + } + + const packet = CoapPacket.generate({ + code: '0', + confirmable: true, + messageId: this._nextMessageID(), + }); + + this._writeData(packet); + } + + _sendFunctionResult(serverPacket: ParsedPacket): void { + if (!this._isConnected) { + return; + } + + const returnValue = Math.ceil(Math.random() * 100000); // Success! + + const packet = CoapPacket.generate({ + code: '2.04', + messageId: this._nextMessageID(), + token: serverPacket.token, + payload: Buffer.from([ + returnValue >> 24, + (returnValue >> 16) & 0xff, + (returnValue >> 8) & 0xff, + returnValue & 0xff, + ]), + }); + + this._writeData(packet); + } + + _sendVariable(serverPacket: ParsedPacket): void { + if (!this._isConnected) { + return; + } + + const returnValue = 1; // Success! + + const result = Math.ceil(Math.random() * 100000); + const packet = CoapPacket.generate({ + code: '2.05', + messageId: this._nextMessageID(), + token: serverPacket.token, + payload: Buffer.from([ + result >> 24, + (result >> 16) & 0xff, + (result >> 8) & 0xff, + result & 0xff, + ]), + }); + + this._writeData(packet); + } + + _subscribeWebhooks = async (): Promise => { + await this._subscribe( + `hook-response/test-webhook/${this.getDeviceID()}`, + (packet: ParsedPacket) => {}, + ); + }; + + _subscribe = async ( + eventName: string, + callback: (packet: ParsedPacket) => void, + ): Promise => { + if (!this._isConnected) { + return; + } + + this._eventEmitter.on(eventName, callback); + + const messageID = this._nextMessageID(); + const packet = CoapPacket.generate({ + code: 'GET', + confirmable: true, + messageId: messageID, + options: [ + { + name: 'Uri-Path', + value: Buffer.from(`e/${eventName}`), + }, + ], + }); + + this._writeData(packet); + try { + await this._waitForResponse('ACK'); + } catch (error: any) { + console.log(`No ACK for ${eventName}`); + } + }; + + _sendEvent(eventName: string, payload: Buffer): void { + if (!this._isConnected) { + return; + } + + const packet = CoapPacket.generate({ + code: 'POST', + confirmable: true, + messageId: this._nextMessageID(), + options: [ + { + name: 'Uri-Path', + value: Buffer.from(`e/${eventName}`), + }, + ], + payload, + }); + + this._writeData(packet); + } + + _waitForResponse = async ( + event: string, + messageID?: number, + ): Promise => { + messageID = messageID || this._messageID; + return new Promise( + (resolve: (packet: ParsedPacket) => void, reject: () => void) => { + let timeout = setTimeout(() => reject(), RESPONSE_TIMEOUT); + const handler = (packet: ParsedPacket) => { + if (packet.messageId === messageID) { + if (timeout) { + clearTimeout(timeout); + } + this._eventEmitter.removeListener(event, handler); + resolve(packet); + } + }; + this._eventEmitter.on(event, handler); + }, + ); + }; + + _writeData = (packet: any): void => { + try { + !this._socket.destroyed && this._cipherStream.write(packet); + } catch (ignore: any) {} + }; +} + +export default TCPDevice; diff --git a/packages/particle-collider/src/global.d.ts b/packages/particle-collider/src/global.d.ts new file mode 100644 index 00000000..ddbeb2bf --- /dev/null +++ b/packages/particle-collider/src/global.d.ts @@ -0,0 +1,35 @@ +declare module 'particle-api-js' { + class Particle { + constructor(params: { + clientId: string; + clientSecret: string; + baseUrl: string; + }); + + login(params: { + username: string; + password: string; + }): Promise<{ body: { access_token: string } }>; + createUser(params: { username: string; password: string }): Promise; + sendPublicKey(params: { + auth: string; + deviceId: string; + key: string; + }): Promise; + listWebhooks(params: { auth: string }): Promise<{ body: { id: string }[] }>; + createWebhook(params: Record): Promise; + deleteWebhook(params: { auth: string; hookId: string }): Promise; + callFunction({ + auth: string, + deviceId: string, + name: string, + argument: unknown, + }): Promise; + getVariable({ + auth: string, + deviceId: string, + name: string, + }): Promise; + } + export = Particle; +} diff --git a/packages/particle-collider/src/index.ts b/packages/particle-collider/src/index.ts new file mode 100644 index 00000000..b6fd42eb --- /dev/null +++ b/packages/particle-collider/src/index.ts @@ -0,0 +1,17 @@ +import App from './App'; + +process.on('uncaughtException', (exception: Error) => { + console.error('uncaughtException', { + message: exception.message, + stack: exception.stack, + }); // logging with MetaData +}); + +const app = new App(); +app.run(); + +// const serverUrl = '192.168.0.175'; +// +// const device = new TCPDevice(serverUrl, 5683); +// +// device.connect(); diff --git a/packages/particle-collider/src/lib/ChunkingStream.ts b/packages/particle-collider/src/lib/ChunkingStream.ts new file mode 100644 index 00000000..e66d6a3c --- /dev/null +++ b/packages/particle-collider/src/lib/ChunkingStream.ts @@ -0,0 +1,123 @@ +import { Transform } from 'stream'; + +/** + Our job here is to accept messages in whole chunks, and put their length in front + as we send them out, and parse them back into those size chunks as we read them in. + **/ +/* eslint-disable no-bitwise */ + +const MSG_LENGTH_BYTES = 2; +const messageLengthBytes = ( + message: Buffer | string, +): Buffer | null | undefined => { + // assuming a maximum encrypted message length of 65K, lets write an + // unsigned short int before every message, so we know how much to read out. + if (!message) { + return null; + } + + const length = message.length; + const lengthBuffer = Buffer.alloc(MSG_LENGTH_BYTES); + + lengthBuffer[0] = length >>> 8; + lengthBuffer[1] = length & 255; + + return lengthBuffer; +}; + +type ChunkingStreamOptions = { + outgoing?: boolean; +}; + +class ChunkingStream extends Transform { + _expectedLength!: number; + _incomingBuffer: Buffer | null | undefined = null; + _incomingIndex: number = -1; + _outgoing: boolean; + + constructor(options: ChunkingStreamOptions) { + super(); + + this._outgoing = !!options.outgoing; + } + + process = (chunk: Buffer | null | undefined, callback: any) => { + if (!chunk) { + return; + } + + const isNewMessage = this._incomingIndex === -1; + let startIndex = 0; + if (isNewMessage) { + this._expectedLength = (chunk[0] << 8) + chunk[1]; + + // if we don't have a buffer, make one as big as we will need. + this._incomingBuffer = Buffer.alloc(this._expectedLength); + this._incomingIndex = 0; + startIndex = 2; // skip the first two. + } + + const bytesLeft = this._expectedLength - this._incomingIndex; + let endIndex = startIndex + bytesLeft; + if (endIndex > chunk.length) { + endIndex = chunk.length; + } + + if (startIndex < endIndex && this._incomingBuffer) { + if (this._incomingIndex >= this._incomingBuffer.length) { + throw new Error("hmm, shouldn't end up here."); + } + + chunk.copy( + this._incomingBuffer, + this._incomingIndex, + startIndex, + endIndex, + ); + } + + this._incomingIndex += endIndex - startIndex; + + let remainder: Buffer | null = null; + if (endIndex < chunk.length) { + remainder = Buffer.alloc(chunk.length - endIndex); + chunk.copy(remainder, 0, endIndex, chunk.length); + } + + if (this._incomingIndex === this._expectedLength && this._incomingBuffer) { + this.push(this._incomingBuffer); + this._incomingBuffer = null; + this._incomingIndex = -1; + this._expectedLength = -1; + if (!remainder && callback) { + process.nextTick(callback); + } else { + process.nextTick((): void => this.process(remainder, callback)); + } + } else { + process.nextTick(callback); + } + }; + + _transform = (chunk: Buffer | string, _encoding: string, callback: any) => { + const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); + + if (this._outgoing) { + // we should be passed whole messages here. + // write our length first, then message, then bail. + const lengthChunk = messageLengthBytes(chunk); + this.push(Buffer.concat(lengthChunk ? [lengthChunk, buffer] : [buffer])); + process.nextTick(callback); + } else { + // Collect chunks until we hit an expected size, and then trigger a + // readable + try { + process.nextTick((): void => this.process(buffer, callback)); + } catch (error: any) { + throw new Error(`ChunkingStream error!: ${error}`); + } + } + }; +} + +export default ChunkingStream; diff --git a/packages/particle-collider/src/lib/CoapType.ts b/packages/particle-collider/src/lib/CoapType.ts new file mode 100644 index 00000000..b2da697e --- /dev/null +++ b/packages/particle-collider/src/lib/CoapType.ts @@ -0,0 +1,9 @@ +const CoapType = { + CON: 0, + NON: 1, + ACK: 2, + RESET: 3, + ERROR: 4, +} as const; + +export default CoapType; diff --git a/packages/particle-collider/src/lib/CoapUriType.ts b/packages/particle-collider/src/lib/CoapUriType.ts new file mode 100644 index 00000000..43e32eb6 --- /dev/null +++ b/packages/particle-collider/src/lib/CoapUriType.ts @@ -0,0 +1,11 @@ +const CoapUriType = { + Describe: 'd', + Function: 'f', + Hello: 'h', + PrivateEvent: 'E', + PublicEvent: 'e', + Subscribe: 'e', + Variable: 'v', +} as const; + +export default CoapUriType; diff --git a/packages/particle-collider/src/lib/CryptoManager.ts b/packages/particle-collider/src/lib/CryptoManager.ts new file mode 100644 index 00000000..87c19269 --- /dev/null +++ b/packages/particle-collider/src/lib/CryptoManager.ts @@ -0,0 +1,59 @@ +import crypto from 'crypto'; +import NodeRSA from 'node-rsa'; + +import nullthrows from 'nullthrows'; + +const HASH_TYPE = 'sha1'; + +class CryptoManager { + _privateKey: NodeRSA; + + static _serverKey: NodeRSA | null | undefined; + + constructor(privateKey: NodeRSA) { + this._privateKey = privateKey; + } + + static getServerKey(): NodeRSA { + return nullthrows(CryptoManager._serverKey); + } + + static setServerKey(keyString: string): void { + CryptoManager._serverKey = new NodeRSA(keyString, 'pkcs8-public-pem', { + encryptionScheme: 'pkcs1', + signingScheme: 'pkcs1', + }); + } + + static loadPrivateKey(keyString: string): NodeRSA { + return new NodeRSA(keyString, undefined, { + encryptionScheme: 'pkcs1', + signingScheme: 'pkcs1', + }); + } + + static createKey(): NodeRSA { + return new NodeRSA({ + b: 1024, + }); + } + + static randomBytes(count: number): Buffer { + return crypto.randomBytes(count); + } + + static createHmacDigest = ( + ciphertext: Buffer, + sessionKey: Buffer, + ): Buffer => { + const hmac = crypto.createHmac(HASH_TYPE, sessionKey); + hmac.update(ciphertext); + return hmac.digest(); + }; + + encrypt(buffer: Buffer): Buffer { + return this._privateKey.encryptPrivate(buffer); + } +} + +export default CryptoManager; diff --git a/packages/particle-collider/src/lib/CryptoStream.ts b/packages/particle-collider/src/lib/CryptoStream.ts new file mode 100644 index 00000000..0a47de2f --- /dev/null +++ b/packages/particle-collider/src/lib/CryptoStream.ts @@ -0,0 +1,54 @@ +import crypto from 'crypto'; +import { Transform } from 'stream'; + +export type CryptoStreamType = 'decrypt' | 'encrypt'; + +type CryptoStreamOptions = { + iv: Buffer; + key: Buffer; + streamType: CryptoStreamType; +}; + +class CryptoStream extends Transform { + _key: Buffer; + _iv: Buffer; + _streamType: CryptoStreamType; + + constructor(options: CryptoStreamOptions) { + super(); + + this._key = options.key; + this._iv = options.iv; + this._streamType = options.streamType; + } + + _transform = (chunk: Buffer | string, encoding: string, callback: any) => { + if (!chunk.length) { + throw new Error( + `CryptoStream transform error: Chunk didn't have any length`, + ); + } + + try { + chunk = chunk as Buffer; + const cipherParams = ['aes-128-cbc', this._key, this._iv] as const; + const cipher = + this._streamType === 'encrypt' + ? crypto.createCipheriv(...cipherParams) + : crypto.createDecipheriv(...cipherParams); + + const output = Buffer.concat([cipher.update(chunk), cipher.final()]); + + const ivContainer = this._streamType === 'encrypt' ? output : chunk; + this._iv = Buffer.alloc(16); + ivContainer.copy(this._iv, 0, 0, 16); + + this.push(output); + } catch (error: any) { + throw new Error(`CryptoStream transform error: ${error}`); + } + callback(); + }; +} + +export default CryptoStream; diff --git a/packages/particle-collider/src/lib/NetworkThrottleStream.ts b/packages/particle-collider/src/lib/NetworkThrottleStream.ts new file mode 100644 index 00000000..edf9c30b --- /dev/null +++ b/packages/particle-collider/src/lib/NetworkThrottleStream.ts @@ -0,0 +1,30 @@ +import {Transform} from 'stream'; + +class NetworkThrottleStream extends Transform { + _millisecondDelay: number; + + constructor(millisecondDelay: number) { + super(); + + this._millisecondDelay = millisecondDelay; + } + + _transform = ( + chunk: Buffer | string, + encoding: string, + callback: any, + ) => { + const action = () => { + this.push(chunk); + callback(); + }; + if (!this._millisecondDelay) { + action(); + return; + } + + setTimeout(action, this._millisecondDelay); + } +} + +export default NetworkThrottleStream; diff --git a/packages/particle-collider/src/test-webhook.json b/packages/particle-collider/src/test-webhook.json new file mode 100644 index 00000000..b4a8eba2 --- /dev/null +++ b/packages/particle-collider/src/test-webhook.json @@ -0,0 +1,11 @@ +{ + "event": "test-webhook", + "requestType": "POST", + "responseTopic": "hook-response/test-webhook/{{PARTICLE_DEVICE_ID}}", + "json": { + "PARTICLE_DEVICE_ID": "{{PARTICLE_DEVICE_ID}}", + "PARTICLE_EVENT_VALUE": "{{PARTICLE_EVENT_VALUE}}", + "PARTICLE_PUBLISHED_AT": "{{PARTICLE_PUBLISHED_AT}}", + "payload": "{{payload}}" + } +} diff --git a/packages/particle-collider/tsconfig.json b/packages/particle-collider/tsconfig.json new file mode 100644 index 00000000..ab95b10b --- /dev/null +++ b/packages/particle-collider/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "CommonJS", + "baseUrl": "./src", + "outDir": "./dist", + "typeRoots": ["node_modules/@types", "src/types"], + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "declaration": true, + "allowSyntheticDefaultImports": true, + "noImplicitAny": true, + "moduleResolution": "node", + "sourceMap": true, + "experimentalDecorators": true, + "resolveJsonModule": true, + "allowJs": true + }, + "include": ["src"], + "exclude": ["node_modules", "dist"], + "ts-node": { + "compilerOptions": { + "module": "CommonJS" + }, + "files": true + } +} diff --git a/packages/spark-protocol/.editorconfig b/packages/spark-protocol/.editorconfig new file mode 100644 index 00000000..e24e92fd --- /dev/null +++ b/packages/spark-protocol/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 2 diff --git a/packages/spark-protocol/.eslintignore b/packages/spark-protocol/.eslintignore new file mode 100644 index 00000000..1322a47c --- /dev/null +++ b/packages/spark-protocol/.eslintignore @@ -0,0 +1,14 @@ +dist +doc +flow-typed + +# Don't check auto-generated stuff +coverage +data +node_modules +third-party + +# Cruft +.DS_Store +npm-debug.log +.idea diff --git a/packages/spark-protocol/.eslintrc b/packages/spark-protocol/.eslintrc new file mode 100644 index 00000000..07b00f73 --- /dev/null +++ b/packages/spark-protocol/.eslintrc @@ -0,0 +1,50 @@ +{ + "root": true, + "parserOptions": { + "project": "./tsconfig.json", + }, + "plugins": ["@typescript-eslint", "import", "prettier"], + "extends": [ + "airbnb-typescript/base", + "prettier", + "plugin:@typescript-eslint/recommended", + "plugin:import/typescript", + ], + "parser": "@typescript-eslint/parser", + "rules": { + "eol-last": 2, + "import/first": 0, + "import/newline-after-import": 0, + "import/no-duplicates": 0, + "import/no-extraneous-dependencies": 0, + "import/no-named-as-default": 0, + "import/no-unresolved": 2, + "import/prefer-default-export": 0, + "newline-per-chained-call": 0, + "no-confusing-arrow": 0, + "no-console": 0, + "no-duplicate-imports": 0, + "no-mixed-operators": 0, + "no-underscore-dangle": 0, + "no-use-before-define": 0, + "class-methods-use-this": "off", + "no-promise-executor-return": "off", + "quotes": [ + 2, + "single", + { + "avoidEscape": true, + }, + ], + "semi": 2, + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", // or "error" + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + }, + ], + }, +} diff --git a/packages/spark-protocol/.gitattributes b/packages/spark-protocol/.gitattributes new file mode 100644 index 00000000..178a3fb8 --- /dev/null +++ b/packages/spark-protocol/.gitattributes @@ -0,0 +1,2 @@ +# hide dist files in commit diffs. +dist/* linguist-generated diff --git a/packages/spark-protocol/.gitignore b/packages/spark-protocol/.gitignore new file mode 100644 index 00000000..4e1c75d9 --- /dev/null +++ b/packages/spark-protocol/.gitignore @@ -0,0 +1,33 @@ +# ide +.idea + +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Deployed apps should consider commenting this line out: +# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git +node_modules +.DS_Store +/spark-protocol.esproj +third-party +data +.env diff --git a/packages/spark-protocol/.prettierrc b/packages/spark-protocol/.prettierrc new file mode 100644 index 00000000..bbee69b7 --- /dev/null +++ b/packages/spark-protocol/.prettierrc @@ -0,0 +1,6 @@ +{ + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "trailingComma": "all" +} \ No newline at end of file diff --git a/packages/spark-protocol/.vscode/launch.json b/packages/spark-protocol/.vscode/launch.json new file mode 100644 index 00000000..73a5fdbb --- /dev/null +++ b/packages/spark-protocol/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Node.js-Debugattribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Programm starten", + "program": "${workspaceRoot}\\dist\\scripts\\update-firmware-binaries.js" + } + ] +} \ No newline at end of file diff --git a/packages/spark-protocol/LICENSE.txt b/packages/spark-protocol/LICENSE.txt new file mode 100644 index 00000000..1dd90f2a --- /dev/null +++ b/packages/spark-protocol/LICENSE.txt @@ -0,0 +1,165 @@ +GNU LESSER 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. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/packages/spark-protocol/README.md b/packages/spark-protocol/README.md new file mode 100644 index 00000000..00df38f8 --- /dev/null +++ b/packages/spark-protocol/README.md @@ -0,0 +1,10 @@ + + +Changelog +========= + +0.1.5 - cleaning up connection key logging, adding early data patch +0.1.4 - adding verbose logging option +0.1.3 - adding OTA size workaround +0.0.2 - Working alpha version, needs refactor for API wrapper +0.0.1 - Inital imports and cleanup of base classes \ No newline at end of file diff --git a/packages/spark-protocol/doc/INSTALL.md b/packages/spark-protocol/doc/INSTALL.md new file mode 100644 index 00000000..60378fe0 --- /dev/null +++ b/packages/spark-protocol/doc/INSTALL.md @@ -0,0 +1,35 @@ + + + + +Advanced Install Details: + + + +Installing on Windows +============ + +64 bit windows +-------- + +Node.js (64bit): +https://dl.dropboxusercontent.com/u/36134145/Spark-cli/node-v0.10.29-x64.msi + +OpenSSL(64bit): +https://dl.dropboxusercontent.com/u/36134145/Spark-cli/Win64OpenSSL_Light-1_0_1h.exe + +Visual C++ Redistributable (64bit): +https://dl.dropboxusercontent.com/u/36134145/Spark-cli/vcredist_x64.exe + + +32 bit windows +-------- + +Visual C++ Redistributable (32bit): +https://dl.dropboxusercontent.com/u/36134145/Spark-cli/vcredist_x86.exe + +Node.js (32bit): +https://dl.dropboxusercontent.com/u/36134145/Spark-cli/node-v0.10.29-x86.msi + +OpenSSL(32bit): +https://dl.dropboxusercontent.com/u/36134145/Spark-cli/Win32OpenSSL_Light-1_0_1h.exe \ No newline at end of file diff --git a/packages/spark-protocol/doc/usage.md b/packages/spark-protocol/doc/usage.md new file mode 100644 index 00000000..082fcb74 --- /dev/null +++ b/packages/spark-protocol/doc/usage.md @@ -0,0 +1,22 @@ + + +Keys! +==================== + +Create your keys + +Keep your private key secret + +Wire up your server public key into your settings / module + +Create a special version of your key with the server DNS name / IP address +Copy your server public key to your device + +Copy your device public key into the server + + +Running the server +==================== + +Startup a tcp server on the port of your choosing, and startup a Device object with each new socket that's opened + diff --git a/packages/spark-protocol/jest.config.js b/packages/spark-protocol/jest.config.js new file mode 100644 index 00000000..c10f4da5 --- /dev/null +++ b/packages/spark-protocol/jest.config.js @@ -0,0 +1,6 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/src/**/*.test.ts'], +}; diff --git a/packages/spark-protocol/package.json b/packages/spark-protocol/package.json new file mode 100644 index 00000000..9a31a853 --- /dev/null +++ b/packages/spark-protocol/package.json @@ -0,0 +1,92 @@ +{ + "name": "@brewskey/spark-protocol", + "version": "1.0.4", + "main": "./dist/index.js", + "repository": { + "type": "git", + "url": "https://github.com/brewskey/spark-protocol" + }, + "files": [ + "dist" + ], + "homepage": "https://github.com/brewskey/spark-protocol", + "bugs": "https://github.com/brewskey/spark-protocol/issues", + "contributors": [ + { + "name": "Kenneth Lim", + "email": "kennethlimcp@gmail.com", + "url": "https://github.com/kennethlimcp" + }, + { + "name": "Emily Rose", + "email": "emily@spark.io", + "url": "https://github.com/emilyrose" + }, + { + "name": "John Kalberer", + "email": "john@brewskey.com", + "url": "https://github.com/jlkalberer" + } + ], + "license": "LGPL-3.0", + "scripts": { + "build": "tsc", + "lint": "eslint --fix --quiet -- src", + "lint-staged": "lint-staged", + "prettify": "prettier --write src/*/**.ts", + "start": "tsc --watch", + "update-firmware": "ts-node ./src/scripts/update-firmware-binaries.ts", + "test": "jest", + "test:watch": "jest --watch" + }, + "bin": { + "update-firmware": "dist/scripts/update-firmware-binaries.js" + }, + "dependencies": { + "@particle/device-constants": "^3.3.1", + "binary-version-reader": "https://github.com/particle-iot/binary-version-reader", + "buffer-crc32": "~1.0.0", + "bunyan": "^1.8.15", + "chalk": "^5.3.0", + "coap-packet": "^1.1.1", + "constitute": "^1.6.2", + "dotenv": "^16.4.3", + "ec-key": "^0.0.4", + "hogan.js": "*", + "mkdirp": "^3.0.1", + "moment": "^2.30.1", + "moniker": "^0.1.2", + "node-rsa": "^1.1.1", + "nullthrows": "^1.1.1", + "promise-retry": "^2.0.1", + "request": "^2.83.0", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@octokit/rest": "^20.0.2", + "@types/buffer-crc32": "^0.2.4", + "@types/bunyan": "^1.8.11", + "@types/hogan.js": "^3.0.5", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.17", + "@types/node-rsa": "^1.1.4", + "@types/sinon": "^17.0.3", + "@types/uuid": "^9.0.8", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.2.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.1.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-prettier": "^5.1.3", + "jest": "^29.7.0", + "lint-staged": "^15.2.2", + "pre-commit": "^1.2.2", + "prettier": "^3.2.5", + "sinon": "^17.0.1", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", + "typescript": "^5.3.3" + } +} diff --git a/packages/spark-protocol/src/__tests__/EventPublisher.test.ts b/packages/spark-protocol/src/__tests__/EventPublisher.test.ts new file mode 100644 index 00000000..1230d7c5 --- /dev/null +++ b/packages/spark-protocol/src/__tests__/EventPublisher.test.ts @@ -0,0 +1,266 @@ +import sinon from 'sinon'; +import TestData from './setup/TestData'; + +import EventPublisher from '../lib/EventPublisher'; +import { getRequestEventName } from '../lib/EventPublisher'; +import { ProtocolEvent } from '../types'; +import nullthrows from 'nullthrows'; + +const delay = (milliseconds: number) => + new Promise( + (resolve: (_: void) => void): NodeJS.Timeout => + setTimeout(resolve, milliseconds), + ); + +// todo fix this if find better approach +// we use delay to ensure events being published by eventPublisher +// the method has its caveats, obvious one: hardcoded delay is bad. +// and not obvious: we run tests in parallel so, if delay will be +// too small but there is huge amount of tests, some of them could fail +// because of that. +const DELAY_TIME = 100; + +const TEST_EVENT_NAME = 'testEvent'; + +describe('EventPublisher', () => { + test('should subscribe to event', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const eventData = { + name: TEST_EVENT_NAME, + userID: TestData.getID(), + } as const; + + eventPublisher.subscribe(eventData.name, handler, { + filterOptions: { userID: eventData.userID }, + }); + + eventPublisher.publish(eventData); + + await delay(DELAY_TIME); + expect(handler.called).toBeTruthy(); + }); + + test('should listen for public event from another owner device', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const eventData = { + name: TEST_EVENT_NAME, + userID: TestData.getID(), + } as const; + + eventPublisher.subscribe(eventData.name, handler, { + filterOptions: { userID: TestData.getID() }, + }); + + eventPublisher.publish(eventData, { isPublic: true }); + + await delay(DELAY_TIME); + expect(handler.called).toBeTruthy(); + }); + + test('should filter private event', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const eventData = { + name: TEST_EVENT_NAME, + userID: TestData.getID(), + } as const; + + eventPublisher.subscribe(eventData.name, handler, { + filterOptions: { userID: TestData.getID() }, + }); + + eventPublisher.publish(eventData, { isPublic: false }); + + await delay(DELAY_TIME); + expect(handler.called).toBeFalsy(); + }); + + test('should filter internal event', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const eventData = { + name: TEST_EVENT_NAME, + } as const; + + eventPublisher.subscribe(eventData.name, handler, { + filterOptions: { listenToInternalEvents: false }, + }); + + eventPublisher.publish(eventData, { isInternal: true }); + + await delay(DELAY_TIME); + expect(handler.called).toBeFalsy(); + }); + + test('should filter event by connectionID', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const connectionID = '123'; + const eventData = { + name: TEST_EVENT_NAME, + userID: TestData.getID(), + } as const; + + eventPublisher.subscribe(eventData.name, handler, { + filterOptions: { connectionID }, + }); + + eventPublisher.publish(eventData, { isPublic: false }); + + await delay(DELAY_TIME); + expect(handler.called).toBeFalsy(); + }); + + test('should filter event by deviceID', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const ownerID = TestData.getID(); + const deviceEvent = { + name: TEST_EVENT_NAME, + userID: ownerID, + deviceID: TestData.getID(), + } as const; + + // event from api or webhook-response + const notDeviceEvent = { + name: TEST_EVENT_NAME, + userID: ownerID, + } as const; + + eventPublisher.subscribe(deviceEvent.name, handler, { + filterOptions: { + deviceID: TestData.getID(), + userID: deviceEvent.userID, + }, + }); + + eventPublisher.publish(deviceEvent, { isPublic: false }); + eventPublisher.publish(notDeviceEvent, { isPublic: false }); + + await delay(DELAY_TIME); + expect(handler.called).toBeFalsy(); + }); + + test('should filter broadcasted events', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const ownerID = TestData.getID(); + const deviceEvent = { + broadcasted: true, + deviceID: TestData.getID(), + name: TEST_EVENT_NAME, + userID: ownerID, + } as const; + + eventPublisher.subscribe(deviceEvent.name, handler, { + filterOptions: { + listenToBroadcastedEvents: false, + }, + }); + + eventPublisher.publish(deviceEvent, { isPublic: false }); + + await delay(DELAY_TIME); + expect(handler.called).toBeFalsy(); + }); + + test('should listen for mydevices events only', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const ownerID = TestData.getID(); + + const myDevicePublicEvent = { + name: TEST_EVENT_NAME, + userID: ownerID, + deviceID: TestData.getID(), + } as const; + + const myDevicesPrivateEvent = { + name: TEST_EVENT_NAME, + userID: ownerID, + deviceID: TestData.getID(), + } as const; + + const anotherOwnerPublicEvent = { + name: TEST_EVENT_NAME, + userID: TestData.getID(), + deviceID: TestData.getID(), + } as const; + + eventPublisher.subscribe(TEST_EVENT_NAME, handler, { + filterOptions: { + mydevices: true, + userID: ownerID, + }, + }); + + eventPublisher.publish(myDevicePublicEvent, { isPublic: true }); + await delay(DELAY_TIME); + expect(handler.callCount).toEqual(1); + + eventPublisher.publish(myDevicesPrivateEvent, { isPublic: false }); + await delay(DELAY_TIME); + expect(handler.callCount).toEqual(2); + + eventPublisher.publish(anotherOwnerPublicEvent, { isPublic: true }); + await delay(DELAY_TIME); + expect(handler.callCount).toEqual(2); + }); + + test('should unsubscribe all subscriptions by subscriberID', async () => { + const eventPublisher = new EventPublisher(); + const handler = sinon.spy(); + const subscriberID = TestData.getID(); + + const event = { + name: TEST_EVENT_NAME, + } as const; + + eventPublisher.subscribe(event.name, handler, { subscriberID }); + + eventPublisher.subscribe(event.name, handler, { subscriberID }); + + eventPublisher.publish(event, { isPublic: true }); + + await delay(DELAY_TIME); + expect(handler.callCount).toEqual(2); + + eventPublisher.unsubscribeBySubscriberID(subscriberID); + eventPublisher.publish(event, { isPublic: true }); + + await delay(DELAY_TIME); + expect(handler.callCount).toEqual(2); + }); + + test('should publish and listen for response', async () => { + const eventPublisher = new EventPublisher(); + const subscriberID = TestData.getID(); + const testContextData = '123'; + + const responseHandler = async ( + event: ProtocolEvent<{ data: unknown; responseEventName: string }>, + ) => { + const { data, responseEventName } = nullthrows(event.context); + + eventPublisher.publish({ + name: responseEventName, + context: data, + }); + }; + + eventPublisher.subscribe( + getRequestEventName(TEST_EVENT_NAME), + responseHandler, + { subscriberID }, + ); + + const response = await eventPublisher.publishAndListenForResponse({ + name: TEST_EVENT_NAME, + context: { data: testContextData }, + }); + + expect(response).toEqual(testContextData); + }); +}); diff --git a/packages/spark-protocol/src/__tests__/FirmwareManager.test.ts b/packages/spark-protocol/src/__tests__/FirmwareManager.test.ts new file mode 100644 index 00000000..a5650946 --- /dev/null +++ b/packages/spark-protocol/src/__tests__/FirmwareManager.test.ts @@ -0,0 +1,220 @@ +import FirmwareManager from '../lib/FirmwareManager'; +import { SystemInformation } from 'binary-version-reader'; + +describe('FirmwareManager', () => { + test('should subscribe to event', async () => { + const SYSTEM: SystemInformation = { + f: [], + v: {}, + p: 8, + m: [ + { + s: 16384, + l: 'm', + vc: 30, + vv: 30, + f: 'b', + n: '0', + v: 11, + d: [], + }, + { + s: 262144, + l: 'm', + vc: 30, + vv: 30, + f: 's', + n: '1', + v: 109, + d: [], + }, + { + s: 262144, + l: 'm', + vc: 30, + vv: 30, + f: 's', + n: '2', + v: 109, + d: [ + { + f: 's', + n: '1', + v: 109, + _: '', + }, + ], + }, + { + s: 131072, + l: 'm', + vc: 30, + vv: 26, + u: '9AA9B022074E20643188FEC98EB2FEE61E72BB6B5BEDDEAAACB77070E7CFCE3C', + f: 'u', + n: '1', + v: 5, + d: [ + { + f: 's', + n: '2', + v: 1002, + _: '', + }, + ], + }, + { + s: 131072, + l: 'f', + vc: 30, + vv: 0, + d: [], + }, + ], + }; + + const result = await FirmwareManager.getOtaSystemUpdateConfig(SYSTEM); + expect(result).toMatchObject({ + allModuleFunctions: ['s', 's', 'b'], + allModuleIndices: [1, 2, 0], + allUpdateFiles: [ + 'system-part1-1.0.1-p1.bin', + 'system-part2-1.0.1-p1.bin', + 'bootloader-1.0.1-p1.bin', + ], + }); + }); + + test('should not get any updates', async () => { + const NO_UPDATES_FOR_DEVICE: SystemInformation = { + f: [], + v: {}, + p: 6, + m: [ + { + s: 16384, + l: 'm', + vc: 30, + vv: 30, + f: 'b', + n: '0', + v: 1003, + d: [], + }, + { + s: 262144, + l: 'm', + vc: 30, + vv: 30, + f: 's', + n: '1', + v: 2008, + d: [ + { + f: 's', + n: '2', + v: 207, + _: '', + }, + ], + }, + { + s: 262144, + l: 'm', + vc: 30, + vv: 28, + f: 's', + n: '2', + v: 2008, + d: [ + { + f: 's', + n: '1', + v: 2008, + _: '', + }, + { + f: 'b', + n: '0', + v: 1003, + _: '', + }, + ], + }, + { + s: 131072, + l: 'm', + vc: 30, + vv: 30, + u: '27AB07E6ABA1F2CE920BEC14DC118D430DF89DE833766C8AF6D4EAE4C05CF22D', + f: 'u', + n: '1', + v: 6, + d: [ + { + f: 's', + n: '2', + v: 2008, + _: '', + }, + ], + }, + ], + }; + + const result = await FirmwareManager.getOtaSystemUpdateConfig( + NO_UPDATES_FOR_DEVICE, + ); + expect(result).toBeNull(); + }); + + test('should find updates for firmware', async () => { + const BAD_DEVICE_THAT_WONT_UPDATE: SystemInformation = { + f: [], + v: {}, + p: 8, + m: [ + { s: 16384, l: 'm', vc: 30, vv: 30, f: 'b', n: '0', v: 1100, d: [] }, + { s: 262144, l: 'm', vc: 30, vv: 30, f: 's', n: '1', v: 207, d: [] }, + { + s: 262144, + l: 'm', + vc: 30, + vv: 30, + f: 's', + n: '2', + v: 207, + d: [ + { f: 's', n: '1', v: 207, _: '' }, + { f: 'b', n: '0', v: 101, _: '' }, + ], + }, + { + s: 131072, + l: 'm', + vc: 30, + vv: 26, + u: '9AA9B022074E20643188FEC98EB2FEE61E72BB6B5BEDDEAAACB77070E7CFCE3C', + f: 'u', + n: '1', + v: 5, + d: [{ f: 's', n: '2', v: 1002, _: '' }], + }, + { s: 131072, l: 'f', vc: 30, vv: 0, d: [] }, + ], + }; + + const result = await FirmwareManager.getOtaSystemUpdateConfig( + BAD_DEVICE_THAT_WONT_UPDATE, + ); + + expect(result).toMatchObject({ + allModuleFunctions: ['s', 's'], + allModuleIndices: [1, 2], + allUpdateFiles: [ + 'system-part1-1.0.1-p1.bin', + 'system-part2-1.0.1-p1.bin', + ], + }); + }); +}); diff --git a/packages/spark-protocol/src/__tests__/setup/TestData.ts b/packages/spark-protocol/src/__tests__/setup/TestData.ts new file mode 100644 index 00000000..111016e7 --- /dev/null +++ b/packages/spark-protocol/src/__tests__/setup/TestData.ts @@ -0,0 +1,17 @@ +import * as uuid from 'uuid'; + +const uuidSet = new Set(); + +class TestData { + static getID(): string { + let newID = uuid.v4().toLowerCase(); + while (uuidSet.has(newID)) { + newID = uuid.v4().toLowerCase(); + } + + uuidSet.add(newID); + return newID; + } +} + +export default TestData; diff --git a/packages/spark-protocol/src/clients/Device.ts b/packages/spark-protocol/src/clients/Device.ts new file mode 100644 index 00000000..b270bf67 --- /dev/null +++ b/packages/spark-protocol/src/clients/Device.ts @@ -0,0 +1,1264 @@ +import type { Socket } from 'net'; +import type { Duplex } from 'stream'; +import type { + ParsedPacket as CoapPacket, + Option as CoapOption, +} from 'coap-packet'; +import EventEmitter from 'events'; +import nullthrows from 'nullthrows'; +import type { DeviceAttributes, ProtocolEvent } from '../types'; +import type Handshake from '../lib/Handshake'; +import type { MessageType } from '../lib/MessageSpecifications'; + +import CoapMessage from '../lib/CoapMessage'; +import CryptoManager from '../lib/CryptoManager'; +import CoapMessages from '../lib/CoapMessages'; +import Flasher from '../lib/Flasher'; +import settings from '../settings'; +import Logger from '../lib/logger'; +import BunyanLogger from 'bunyan'; +import { FileTransferStore } from '../lib/FileTransferStore'; +import { SystemInformation } from 'binary-version-reader'; + +type FunctionState = { + f: Array | null | undefined; + v: Record | null | undefined; +}; +type DeviceDescription = { + functionState: FunctionState; + systemInformation: SystemInformation; +}; + +type DeviceStatus = 1 | 2 | 3 | 4; + +type GetHelloInfo = { + particleProductId: number; + platformId: number; + productFirmwareVersion: number; + reservedFlags: number; +}; + +// Hello — sent first by Device then by Server immediately after handshake, never again +// Ignored — sent by either side to respond to a message with a bad counter value. +// The receiver of an Ignored message can optionally decide to resend a previous message +// if the indicated bad counter value matches a recently sent message. + +// package flasher +// Chunk — sent by Server to send chunks of a firmware binary to Device +// ChunkReceived — sent by Device to respond to each chunk, +// indicating the CRC of the received chunk data. +// if Server receives CRC that does not match the chunk just sent, that chunk is sent again +// UpdateBegin — sent by Server to initiate an OTA firmware update +// UpdateReady — sent by Device to indicate readiness to receive firmware chunks +// UpdateDone — sent by Server to indicate all firmware chunks have been sent + +// FunctionCall — sent by Server to tell Device to call a user-exposed function +// FunctionReturn — sent by Device in response to FunctionCall to indicate return value. +// void functions will not send this message +// VariableRequest — sent by Server to request the value of a user-exposed variable +// VariableValue — sent by Device in response to VariableRequest to indicate the value + +// Event — sent by Device to initiate a Server Sent Event and optionally +// an HTTP callback to a 3rd party +// KeyChange — sent by Server to change the AES credentials + +/** + * How high do our counters go before we wrap around to 0? + * (CoAP maxes out at a 16 bit int) + */ +const COUNTER_MAX = 65536; +/** + * How big can our tokens be in CoAP messages? + */ +const TOKEN_COUNTER_MAX = 256; +const { KEEP_ALIVE_TIMEOUT } = settings; +const { SOCKET_TIMEOUT } = settings; + +export const DEVICE_EVENT_NAMES = { + DISCONNECT: 'disconnect', + FLASH_FAILED: 'flash/failed', + FLASH_STARTED: 'flash/started', + FLASH_SUCCESS: 'flash/success', + READY: 'ready', +} as const; + +export const SYSTEM_EVENT_NAMES = { + APP_HASH: 'spark/device/app-hash', + CLAIM_CODE: 'spark/device/claim/code', + FLASH_AVAILABLE: 'spark/flash/available', + FLASH_PROGRESS: 'spark/flash/progress', + FLASH_STATUS: 'spark/flash/status', + GET_IP: 'particle/device/ip', + GET_NAME: 'particle/device/name', + GET_RANDOM_BUFFER: 'particle/device/random', + IDENTITY: 'spark/device/ident/0', + LAST_RESET: 'spark/device/last_reset', // This should just have a friendly string in its payload. + MAX_BINARY: 'spark/hardware/max_binary', + OTA_CHUNK_SIZE: 'spark/hardware/ota_chunk_size', + OTA_RESULT: 'spark/device/ota_result', + RESET: 'spark/device/reset', // send this to reset passing "safe mode"/"dfu"/"reboot" + SAFE_MODE: 'spark/device/safemode', + SAFE_MODE_UPDATING: 'spark/safe-mode-updater/updating', + SPARK_STATUS: 'spark/status', + SPARK_SUBSYSTEM: 'spark/cc3000-patch-version', + UPDATES_ENABLED: 'particle/device/updates/enabled', + UPDATES_FORCED: 'particle/device/updates/forced', +} as const; + +// These constants should be consistent with message names in +// MessageSpecifications.js +export const DEVICE_MESSAGE_EVENTS_NAMES = { + GET_TIME: 'GetTime', + PRIVATE_EVENT: 'PrivateEvent', + PUBLIC_EVENT: 'PublicEvent', + SUBSCRIBE: 'Subscribe', +} as const; + +export const DEVICE_STATUS_MAP = { + GOT_DESCRIPTION: 3, + GOT_HELLO: 2, + INITIAL: 1, + READY: 4, +} as const; + +const NEW_STATUS_EVENT_NAME = 'newStatus'; + +type AttributesFromDevice = { + particleProductId: number; + platformId: number; + productFirmwareVersion: number; + reservedFlags: number; +}; + +/** + * Implementation of the Particle messaging protocol + * @Device + */ +class Device extends EventEmitter { + _logger: BunyanLogger; + + _attributes: DeviceAttributes = { + appHash: null, + deviceID: '', + functions: null, + ip: 'unkonwn', + lastHeard: null, + name: '', + ownerID: null, + particleProductId: 0, + platformId: 0, + productFirmwareVersion: 0, + registrar: null, + reservedFlags: 0, + variables: null, + lastFlashedAppName: undefined, + timestamp: new Date(), + connected: false, + }; + + _attributesFromDevice: AttributesFromDevice = { + particleProductId: 0, + platformId: 0, + productFirmwareVersion: 0, + reservedFlags: 0, + }; + + _cipherStream: Duplex | null | undefined = null; + + _connectionKey: string | null | undefined = null; + + _connectionStartTime: Date | null | undefined = null; + + _decipherStream: Duplex | null | undefined = null; + + _disconnectCounter: number = 0; + + _isFlashing: boolean = false; + + _maxBinarySize: number | null | undefined = null; + + _otaChunkSize: number | null | undefined = null; + + _owningFlasher: Flasher | null | undefined; + + _receiveCounter: number = 0; + + _sendCounter: number = 0; + + _sendToken: number = 0; + + _socket: Socket; + + _socketTimeoutInterval: ReturnType | undefined = undefined; + + _status: DeviceStatus = DEVICE_STATUS_MAP.INITIAL; + + _statusEventEmitter: EventEmitter = new EventEmitter(); + + _systemInformation: SystemInformation | undefined; + + _tokens: { + [key: string]: MessageType; + } = {}; + + _handshake: Handshake; + + constructor(socket: Socket, connectionKey: string, handshake: Handshake) { + super(); + + this._connectionKey = connectionKey; + this._socket = socket; + this._handshake = handshake; + + this._logger = Logger.createModuleLogger(module, { connectionKey }); + } + + // emit(type, ...args: Array) { + // const packet = args[0]; + // const eventData = + // packet != null + // ? { + // connectionID: this.getConnectionKey(), + // deviceID: this._attributes.deviceID, + // name: CoapMessages.getUriPath(packet).substr(3), + // ttl: CoapMessages.getMaxAge(packet), + // } + // : new Error(); + + // this._logger.info(eventData, `Device Event: ${ type}`); + // super.emit(type, ...args); + // } + + getAttributes(): DeviceAttributes { + return { + ...this._attributes, + ...this._attributesFromDevice, + }; + } + + getStatus(): DeviceStatus { + return this._status; + } + + getSystemInformation(): SystemInformation { + return nullthrows(this._systemInformation); + } + + isFlashing(): boolean { + return this._isFlashing; + } + + updateAttributes(attributes: Partial): DeviceAttributes { + this._attributes = { + ...this._attributes, + ...attributes, + ...this._attributesFromDevice, + }; + + this._logger = Logger.createModuleLogger(module, { + connectionKey: this._connectionKey, + deviceID: this.getDeviceID(), + attributes: this._attributes, + }); + + return this._attributes; + } + + setMaxBinarySize(maxBinarySize: number) { + this._maxBinarySize = maxBinarySize; + } + + setOtaChunkSize(maxBinarySize: number) { + this._otaChunkSize = maxBinarySize; + } + + setStatus(status: DeviceStatus) { + this._status = status; + this._statusEventEmitter.emit(NEW_STATUS_EVENT_NAME, status); + } + + async hasStatus(status: DeviceStatus): Promise { + if (status <= this._status) { + return Promise.resolve(); + } + + return new Promise((resolve: () => void) => { + const deviceStatusListener = (newStatus: DeviceStatus) => { + if (status <= newStatus) { + resolve(); + this._statusEventEmitter.removeListener( + NEW_STATUS_EVENT_NAME, + deviceStatusListener, + ); + } + }; + + this._statusEventEmitter.on(NEW_STATUS_EVENT_NAME, deviceStatusListener); + }); + } + + /** + * configure our socket and start the handshake + */ + async startProtocolInitialization(): Promise { + this._socket.setNoDelay(true); + this._socket.setKeepAlive(true, KEEP_ALIVE_TIMEOUT); // every 15 second(s) + this._socket.setTimeout(SOCKET_TIMEOUT); + + this._socket.on('error', (error: Error): void => + this.disconnect(`socket error: ${error.message}`), + ); + this._socket.on('close', (): void => this.disconnect('socket close')); + this._socket.on('timeout', (): void => this.disconnect('socket timeout')); + + return this.startHandshake(); + } + + async startHandshake(): Promise { + // when the handshake is done, we can expect two stream properties, + // '_decipherStream' and '_cipherStream' + try { + const result = await this._handshake.start(this); + + if (!result) { + throw new Error('Handshake result undefined'); + } + + const { cipherStream, decipherStream, deviceID, handshakeBuffer } = + result; + + this._cipherStream = cipherStream; + this._decipherStream = decipherStream; + + const getHelloInfo = this._getHello(handshakeBuffer); + + this.updateAttributes({ + ...(getHelloInfo || {}), + deviceID, + ip: this.getRemoteIPAddress(), + }); + this.setStatus(DEVICE_STATUS_MAP.GOT_HELLO); + + return deviceID; + } catch (error) { + this.disconnect(error); + throw error; + } + } + + async completeProtocolInitialization(): Promise { + try { + const decipherStream = this._decipherStream; + if (!decipherStream) { + throw new Error('decipherStream not set.'); + } + + decipherStream.on('readable', () => { + const read = (): Buffer => decipherStream.read() as Buffer; + + let chunk = read(); + while (chunk !== null) { + this._clientHasWrittenToSocket(); + this.routeMessage(chunk); + chunk = read(); + } + this._clientHasWrittenToSocket(); + }); + + // Wait for Device to set things up + await new Promise((resolve: (_: void) => void): void => { + setTimeout((): void => resolve(), 100); + }); + + // Wait for this thing to be readable before sending any messages + // await new Promise((resolve: () => void) => { + // decipherStream.once('readable', resolve); + // }); + + await this._sendHello(); + this._connectionStartTime = new Date(); + + // Wait for Device to set things up + await new Promise((resolve: (_: void) => void): void => { + setTimeout((): void => resolve(), 100); + }); + + // Bake in some retries + const { functionState, systemInformation } = await this._getDescription(); + this._systemInformation = systemInformation; + + this.updateAttributes({ + functions: nullthrows(functionState).f, + variables: nullthrows(functionState).v, + }); + + this.setStatus(DEVICE_STATUS_MAP.GOT_DESCRIPTION); + + this._logger.info( + { + cache_key: this._connectionKey, + deviceID: this.getDeviceID(), + firmwareVersion: this._attributesFromDevice.productFirmwareVersion, + ip: this.getRemoteIPAddress(), + particleProductId: this._attributesFromDevice.particleProductId, + platformId: this._attributesFromDevice.platformId, + }, + 'On device protocol initialization complete', + ); + + return systemInformation; + } catch (error) { + this._logger.error( + { ...this._attributes, err: error }, + 'completeProtocolInitialization', + ); + throw error; + } + } + + // This handles the case on some operating systems where `socket.setTimeout` + // doesn't work. On windows, that function will timeout when if the client + // doesn't send a reply. On Linux as long as someone is reading or writing + // to a socket it will stay open. + _clientHasWrittenToSocket() { + if (this._socketTimeoutInterval) { + clearTimeout(this._socketTimeoutInterval); + } + this._socketTimeoutInterval = setTimeout( + (): void => this.disconnect('socket timeout'), + SOCKET_TIMEOUT, + ); + } + + _getHello(chunk: Buffer): GetHelloInfo | null | undefined { + const message = CoapMessages.unwrap(chunk); + if (!message || !message.messageId) { + throw new Error('failed to parse hello'); + } + + this._receiveCounter = message.messageId; + + try { + const { payload } = message; + if (!payload || payload.length <= 0) { + return null; + } + + this._attributesFromDevice = { + particleProductId: payload.readUInt16BE(0), + platformId: payload.readUInt16BE(6), + productFirmwareVersion: payload.readUInt16BE(2), + reservedFlags: payload.readUInt16BE(4), + }; + + this._logger.info(this._attributesFromDevice, 'Connection attributes'); + + if (this._attributesFromDevice.platformId !== 0) { + // This is the maximum for Photon/P1. + // It should be updated for Boron and other types. + this.setMaxBinarySize(384000); + } + + return this._attributesFromDevice; + } catch (error) { + this._logger.error( + { deviceID: this.getDeviceID(), err: error }, + 'Error while parsing hello payload ', + ); + return null; + } + } + + async _sendHello() { + // client will set the counter property on the message + this._sendCounter = CryptoManager.getRandomUINT16(); + this.sendMessage('Hello'); + } + + ping(): { + connected: boolean; + lastHeard: Date | null | undefined; + } { + if (settings.SHOW_VERBOSE_DEVICE_LOGS) { + this._logger.info({ deviceID: this.getDeviceID() }, 'Pinged, replying'); + } + + return { + connected: this._socket !== null, + lastHeard: this._attributes.lastHeard, + }; + } + + /** + * Deals with messages coming from the device over our secure connection + * @param data + */ + routeMessage(data: Buffer) { + const packet = CoapMessages.unwrap(data); + + if (!packet) { + this._logger.error( + { + deviceID: this.getDeviceID(), + }, + 'RouteMessage got a NULL COAP message ', + ); + return; + } + + // make sure the packet always has a number for code... + const messageCode = parseFloat(packet.code); + packet.code = messageCode.toString(); + + // Get the message code (the decimal portion of the code) to determine + // how we should handle the message + let requestType: string | null | undefined = ''; + if ( + messageCode > CoapMessage.Code.EMPTY && + messageCode <= CoapMessage.Code.DELETE + ) { + // probably a request + requestType = CoapMessages.getRequestType(packet); + } + + if (!requestType) { + requestType = this._getResponseType(packet.token || Buffer.from([])); + } + + // This is just a dumb ack packet. We don't really need to do anything + // with it. + if (packet.ack) { + if (!requestType) { + // no type, can't route it. + requestType = 'PingAck'; + } + + this.emit(requestType, packet); + return; + } + + this._incrementReceiveCounter(); + if (packet.code === '0' && packet.confirmable) { + this.updateAttributes({ lastHeard: new Date() }); + this.sendReply('PingAck', packet.messageId); + return; + } + + if (!packet || packet.messageId !== this._receiveCounter) { + this._logger.warn( + { + deviceID: this.getDeviceID(), + expect: this._receiveCounter, + got: packet.messageId, + }, + 'MessageId other than expected', + ); + + if (requestType === 'Ignored') { + // don't ignore an ignore... + this.disconnect('Got an Ignore'); + return; + } + + // this.sendMessage('Ignored', null, {}, null, null); + this.disconnect('Bad Counter'); + return; + } + + this.emit(requestType || '', packet); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendReply any>( + messageName: MessageType, + id: number, + data?: Buffer | null, + token?: number | null, + requester?: InstanceType, + ) { + if (!this._isSocketAvailable(requester || null, messageName)) { + return; + } + + // if my reply is an acknowledgement to a confirmable message + // then I need to re-use the message id... + + // set our counter + if (id < 0) { + this._incrementSendCounter(); + id = this._sendCounter; // eslint-disable-line no-param-reassign + } + + const message = CoapMessages.wrap(messageName, id, null, null, data, token); + if (!message) { + this._logger.error( + { + deviceID: this.getDeviceID(), + }, + 'Device - could not unwrap message', + ); + return; + } + + if (!this._cipherStream) { + this._logger.error( + { + deviceID: this.getDeviceID(), + }, + 'Device - sendReply before READY', + ); + return; + } + + this._cipherStream.write(message); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendMessage any>( + messageName: MessageType, + params?: { + args?: Array | Array; + name?: string; + event_name?: string; + } | null, + options?: Array | null, + data?: Buffer | null, + requester?: InstanceType, + ): number { + if (!this._isSocketAvailable(requester, messageName)) { + return -1; + } + + // increment our counter + this._incrementSendCounter(); + + let token = null; + if (!CoapMessages.isNonTypeMessage(messageName)) { + this._incrementSendToken(); + this._useToken(messageName, this._sendToken); + token = this._sendToken; + } + + const message = CoapMessages.wrap( + messageName, + this._sendCounter, + params, + options, + data, + token, + ); + + if (!message) { + this._logger.error( + { data, deviceID: this.getDeviceID(), messageName, params }, + 'Could not wrap message', + ); + return -1; + } + + if (!this._cipherStream) { + this._logger.error( + { + deviceID: this.getDeviceID(), + messageName, + }, + 'Client - sendMessage before READY', + ); + } + + process.nextTick( + (): boolean => !!this._cipherStream && this._cipherStream.write(message), + ); + + return token || 0; + } + + // Adds a listener to our secure message stream + async listenFor( + eventName: MessageType, + uri?: string | null, + token?: number | null, + ): Promise { + const tokenHex = token ? Device._toHexString(token) : null; + const beVerbose = settings.SHOW_VERBOSE_DEVICE_LOGS; + + return new Promise( + ( + resolve: (packet: CoapPacket) => void, + reject: (error?: Error) => void, + ) => { + const cleanUpListeners = () => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + this.removeListener(eventName, handler); + // eslint-disable-next-line @typescript-eslint/no-use-before-define + this.removeListener('disconnect', disconnectHandler); + }; + + const timeout = setTimeout(() => { + cleanUpListeners(); + reject(new Error(`Request timed out ${eventName}`)); + }, KEEP_ALIVE_TIMEOUT); + + // adds a one time event + const handler = (packet: CoapPacket) => { + clearTimeout(timeout); + const packetUri = CoapMessages.getUriPath(packet); + if (uri && packetUri.indexOf(uri) !== 0) { + if (beVerbose) { + this._logger.warn( + { + deviceID: this.getDeviceID(), + packetUri, + uri, + }, + 'URI filter did not match', + ); + } + reject(new Error('URI filter did not match')); + return; + } + + const packetTokenHex = packet.token?.toString('hex'); + if (tokenHex && tokenHex !== packetTokenHex) { + if (beVerbose) { + this._logger.warn( + { + deviceID: this.getDeviceID(), + packetTokenHex, + tokenHex, + }, + 'Tokens did not match', + ); + } + reject(new Error('Tokens did not match')); + return; + } + cleanUpListeners(); + resolve(packet); + }; + + const disconnectHandler = () => { + cleanUpListeners(); + reject(); + }; + + this.on(eventName, handler); + this.on('disconnect', disconnectHandler); + }, + ); + } + + static _increment(counter: number, maxSize: number): number { + const resultCounter = counter + 1; + return resultCounter < maxSize ? resultCounter : 0; + } + + _incrementSendCounter() { + this._sendCounter = Device._increment(this._sendCounter, COUNTER_MAX); + } + + _incrementReceiveCounter() { + this._receiveCounter = Device._increment(this._receiveCounter, COUNTER_MAX); + } + + // increments or wraps our token value, and makes sure it isn't in use + _incrementSendToken(): number { + this._sendToken = Device._increment(this._sendToken, TOKEN_COUNTER_MAX); + this._clearToken(this._sendToken); + return this._sendToken; + } + + /** + * Associates a particular token with a message we're sending, so we know + * what we're getting back when we get an ACK + */ + _useToken(name: MessageType, sendToken: number) { + const key = Device._toHexString(sendToken); + + if (this._tokens[key]) { + throw new Error( + `Token ${name} ${this._tokens[key]} ${key} already in use`, + ); + } + + this._tokens[key] = name; + } + + // clears the association with a particular token + _clearToken(sendToken: number) { + const key = Device._toHexString(sendToken); + + if (this._tokens[key]) { + delete this._tokens[key]; + } + } + + _getResponseType(token: Buffer): string | null | undefined { + const tokenString = token.toString('hex'); + const request = this._tokens[tokenString]; + if (!request) { + return ''; + } + + return CoapMessages.getResponseType(request); + } + + async getVariableValue(name: string): Promise { + const isBusy = !this._isSocketAvailable(null); + if (isBusy) { + throw new Error('This device is locked during the flashing process.'); + } + + await this.hasStatus(DEVICE_STATUS_MAP.READY); + + if (!this._hasParticleVariable(name)) { + throw new Error('Variable not found'); + } + + const messageToken = this.sendMessage('VariableRequest', { name }); + const message = await this.listenFor('VariableValue', null, messageToken); + + return this._transformVariableResult(name, message); + } + + async callFunction( + functionName: string, + functionArguments: Record, + ): Promise { + const isBusy = !this._isSocketAvailable(null); + if (isBusy) { + throw new Error('This device is locked during the flashing process.'); + } + + await this.hasStatus(DEVICE_STATUS_MAP.READY); + + if (!this._hasSparkFunction(functionName)) { + throw new Error('Function not found'); + } + + this._logger.info( + { + deviceID: this.getDeviceID(), + functionName, + }, + 'sending function call to the device', + ); + + const token = this.sendMessage('FunctionCall', { + args: Object.values(functionArguments), + name: functionName, + }); + const message = await this.listenFor('FunctionReturn', null, token); + return this._transformFunctionResult(functionName, message); + } + + /** + * Asks the device to start or stop its 'raise your hand' signal. + * This will turn `nyan` mode on or off which just flashes the LED a bunch of + * colors. + */ + async raiseYourHand(shouldShowSignal: boolean): Promise { + const isBusy = !this._isSocketAvailable(null); + if (isBusy) { + throw new Error('This device is locked during the flashing process.'); + } + + /** + * does the special URL writing needed directly to the COAP message object, + * since the URI requires non-text values + */ + const buffer = Buffer.alloc(1); + buffer.writeUInt8(shouldShowSignal ? 1 : 0, 0); + + const token = this.sendMessage('SignalStart', null, [ + { + name: CoapMessage.Option.URI_QUERY, + value: buffer, + }, + ]); + + return this.listenFor('SignalStartReturn', null, token); + } + + async flash( + binary: Buffer | null | undefined, + fileTransferStore: FileTransferStore = FileTransferStore.FIRMWARE, + address: string = '0x0', + ): Promise<{ + status: string; + }> { + const isBusy = !this._isSocketAvailable(null); + if (isBusy) { + throw new Error('This device is locked during the flashing process.'); + } + + this._isFlashing = true; + + const flasher = new Flasher(this, this._maxBinarySize, this._otaChunkSize); + try { + this._logger.info( + { + deviceID: this.getDeviceID(), + }, + 'flash device started! - sending api event', + ); + + this.emit(DEVICE_EVENT_NAMES.FLASH_STARTED); + + await flasher.startFlashBuffer(binary, fileTransferStore, address); + + this._logger.info( + { + deviceID: this.getDeviceID(), + }, + 'Flash device finished! - sending api event', + ); + + this.emit(DEVICE_EVENT_NAMES.FLASH_SUCCESS); + this._isFlashing = false; + this._owningFlasher = null; + + return { status: 'Update finished' }; + } catch (error) { + this._logger.error( + { + deviceID: this.getDeviceID(), + err: error, + }, + 'Flash device failed! - sending api event', + ); + + this._isFlashing = false; + + this.emit(DEVICE_EVENT_NAMES.FLASH_FAILED); + return { status: 'Update Failed' }; + } + } + + _isSocketAvailable( + requester?: unknown | null, + messageName?: string, + ): boolean { + if (!this._owningFlasher || this._owningFlasher === requester) { + return true; + } + + this._logger.error( + { + cache_key: this._connectionKey, + deviceID: this.getDeviceID(), + messageName, + }, + 'This client has an exclusive lock', + ); + + return false; + } + + takeOwnership(flasher: Flasher): boolean { + if (this._owningFlasher) { + this._logger.error( + { deviceID: this.getDeviceID() }, + 'Device already owned', + ); + return false; + } + // only permit the owning object to send messages. + this._owningFlasher = flasher; + return true; + } + + releaseOwnership(flasher: Flasher) { + this._logger.info( + { deviceID: this.getDeviceID() }, + 'Releasing flash ownership', + ); + if (this._owningFlasher === flasher) { + this._owningFlasher = null; + } else if (this._owningFlasher) { + this._logger.error( + { deviceID: this.getDeviceID(), flasher }, + "Cannot releaseOwnership, isn't current owner", + ); + } + } + + _transformVariableResult( + name: string, + packet: CoapPacket, + ): Buffer | null | undefined { + // grab the variable type, if the device doesn't say, assume it's a 'string' + const variableType = + (this._attributes.variables && this._attributes.variables[name]) || + 'string'; + + let result: Buffer | null | undefined = null; + try { + if (packet.payload?.length) { + // Leaving raw payload in response message for now, so we don't shock + // our users. + result = CoapMessages.fromBinary( + packet.payload, + variableType, + ) as unknown as Buffer; + } + } catch (error) { + this._logger.error( + { err: error }, + '_transformVariableResult - error transforming response', + ); + } + + return result; + } + + // Transforms the result from a device function to the correct type. + private _transformFunctionResult( + name: string, + packet: CoapPacket, + ): string | number | boolean | Buffer | null | undefined { + const variableType = 'int32'; + + let result: string | number | boolean | Buffer | null = null; + try { + if (packet.payload?.length) { + result = CoapMessages.fromBinary(packet.payload, variableType); + } + } catch (error) { + this._logger.error( + { name, err: error }, + '_transformFunctionResult - error transforming response', + ); + throw error; + } + + return result; + } + + async _getDescription(): Promise { + return new Promise( + ( + resolve: (deviceDescription: DeviceDescription) => void, + reject: (error: Error) => void, + ) => { + let systemInformation: SystemInformation; + let functionState: FunctionState; + + const cleanUpListeners = () => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + this.removeListener('DescribeReturn', handler); + this.removeListener('disconnect', cleanUpListeners); + }; + + const timeout = setTimeout(() => { + cleanUpListeners(); + reject(new Error('Request timed out - Describe')); + }, KEEP_ALIVE_TIMEOUT); + + const handler = (packet: CoapPacket) => { + // Check if it was a bad request and retry + if (Number.parseFloat(packet.code) >= 4) { + this._logger.error( + { + packet, + }, + 'Received error code for Describe message', + ); + cleanUpListeners(); + reject(new Error('Received error code for Describe message')); + return; + } + + const { payload } = packet; + if (!payload?.length) { + this._logger.error( + { + packet, + }, + 'Payload empty for Describe message', + ); + cleanUpListeners(); + reject(new Error('Payload empty for Describe message')); + return; + } + + const data = JSON.parse(payload.toString('utf8')); + + if (!systemInformation && data.m) { + systemInformation = data; + } + + if (data && data.v) { + functionState = data; + // 'v':{'temperature':2} + nullthrows(functionState).v = CoapMessages.translateIntTypes( + nullthrows(data.v), + ); + } + + if (!systemInformation || !functionState) { + return; + } + + clearTimeout(timeout); + cleanUpListeners(); + + resolve({ functionState, systemInformation }); + }; + + this.on('DescribeReturn', handler); + this.on('disconnect', cleanUpListeners); + + // Because some firmware versions do not send the app + system state + // in a single message, we cannot use `listenFor` and instead have to + // write some hacky code that duplicates a lot of the functionality + this.sendMessage('Describe'); + }, + ); + } + + //------------- + // Device Events / Spark.publish / Spark.subscribe + //------------- + onDeviceEvent(event: ProtocolEvent) { + this.sendDeviceEvent(event); + } + + sendDeviceEvent(event: ProtocolEvent) { + const { data, isPublic, name, ttl } = event; + const messageName = isPublic + ? DEVICE_MESSAGE_EVENTS_NAMES.PUBLIC_EVENT + : DEVICE_MESSAGE_EVENTS_NAMES.PRIVATE_EVENT; + + this.sendMessage( + messageName, + { + event_name: name, + }, + [ + { + name: CoapMessage.Option.MAX_AGE, + value: CoapMessages.toBinary(ttl, 'uint32'), + }, + ], + (data && Buffer.from(data)) || null, + ); + } + + _hasParticleVariable(name: string): boolean { + return !!(this._attributes.variables && this._attributes.variables[name]); + } + + _hasSparkFunction(functionName: string): boolean { + return !!( + this._attributes.functions && + this._attributes.functions.some( + (fn: string): boolean => + fn.toLowerCase() === functionName.toLowerCase(), + ) + ); + } + + static _toHexString(value: number): string { + return Buffer.from([value]).toString('hex'); + } + + getDeviceID(): string { + return this._attributes.deviceID; + } + + getConnectionKey(): string | null | undefined { + return this._connectionKey; + } + + getRemoteIPAddress(): string { + return this._socket.remoteAddress + ? this._socket.remoteAddress.toString() + : 'unknown'; + } + + disconnect(message: unknown | null = '') { + this._disconnectCounter += 1; + + if (this._socketTimeoutInterval) { + clearTimeout(this._socketTimeoutInterval); + this._socketTimeoutInterval = undefined; + } + + const logInfo = { + cache_key: this._connectionKey, + deviceID: this.getDeviceID(), + duration: this._connectionStartTime + ? (Date.now() - (this._connectionStartTime?.getTime() || 0)) / 1000.0 + : undefined, + } as const; + + if (this._disconnectCounter > 1) { + return; + } + + try { + this._logger.info( + { + ...logInfo, + disconnectCounter: this._disconnectCounter, + message, + }, + 'Device disconnected', + ); + } catch (error) { + this._logger.error( + { deviceID: this.getDeviceID(), err: error }, + 'Disconnect log error', + ); + } + + if (this._decipherStream) { + try { + this._decipherStream.end(); + this._decipherStream = null; + } catch (error) { + this._logger.error( + { deviceID: this.getDeviceID(), err: error }, + 'Error cleaning up decipherStream', + ); + } + } + + if (this._cipherStream) { + try { + this._cipherStream.end(); + this._cipherStream = null; + } catch (error) { + this._logger.error( + { deviceID: this.getDeviceID(), err: error }, + 'Error cleaning up cipherStream', + ); + } + } + + try { + this._socket.end(); + this._socket.destroy(); + } catch (error) { + this._logger.error( + { deviceID: this.getDeviceID(), err: error }, + 'Disconnect TCPSocket error', + ); + } + + this.emit(DEVICE_EVENT_NAMES.DISCONNECT, message); + + // obv, don't do this before emitting disconnect. + try { + this.removeAllListeners(); + } catch (error) { + this._logger.error( + { deviceID: this.getDeviceID(), err: error }, + 'Problem removing listeners', + ); + } + } +} + +export default Device; diff --git a/packages/spark-protocol/src/defaultBindings.ts b/packages/spark-protocol/src/defaultBindings.ts new file mode 100644 index 00000000..77fa8ff1 --- /dev/null +++ b/packages/spark-protocol/src/defaultBindings.ts @@ -0,0 +1,112 @@ +import type { Container } from 'constitute'; + +import DeviceAttributeFileRepository from './repository/DeviceAttributeFileRepository'; +import DeviceKeyFileRepository from './repository/DeviceKeyFileRepository'; +import DeviceServer from './server/DeviceServer'; +import EventPublisher from './lib/EventPublisher'; +import EventProvider from './lib/EventProvider'; +import ClaimCodeManager from './lib/ClaimCodeManager'; +import CryptoManager from './lib/CryptoManager'; +import MockProductDeviceRepository from './repository/MockProductDeviceRepository'; +import MockProductFirmwareRepository from './repository/MockProductFirmwareRepository'; +import ServerKeyFileRepository from './repository/ServerKeyFileRepository'; +import protocolSettings from './settings'; + +type ServerSettings = { + BINARIES_DIRECTORY?: string; + CONNECTED_DEVICES_LOGGING_INTERVAL: number; + DEVICE_DIRECTORY: string; + ENABLE_SYSTEM_FIRWMARE_AUTOUPDATES: boolean; + SERVER_KEY_FILENAME: string; + SERVER_KEY_PASSWORD?: string; + SERVER_KEYS_DIRECTORY: string; + TCP_DEVICE_SERVER_CONFIG: { + HOST: string; + PORT: number; + }; +}; + +const defaultBindings = ( + container: Container, + serverSettings: ServerSettings, +) => { + const mergedSettings = { ...protocolSettings, ...serverSettings } as const; + + // Settings + container.bindValue('DEVICE_DIRECTORY', mergedSettings.DEVICE_DIRECTORY); + container.bindValue( + 'CONNECTED_DEVICES_LOGGING_INTERVAL', + mergedSettings.CONNECTED_DEVICES_LOGGING_INTERVAL, + ); + container.bindValue( + 'ENABLE_SYSTEM_FIRWMARE_AUTOUPDATES', + mergedSettings.ENABLE_SYSTEM_FIRWMARE_AUTOUPDATES, + ); + container.bindValue( + 'SERVER_KEY_FILENAME', + mergedSettings.SERVER_KEY_FILENAME, + ); + container.bindValue( + 'SERVER_KEY_PASSWORD', + mergedSettings.SERVER_KEY_PASSWORD, + ); + container.bindValue( + 'SERVER_KEYS_DIRECTORY', + mergedSettings.SERVER_KEYS_DIRECTORY, + ); + container.bindValue( + 'TCP_DEVICE_SERVER_CONFIG', + mergedSettings.TCP_DEVICE_SERVER_CONFIG, + ); + container.bindValue( + 'ALLOW_DEVICE_TO_PROVIDE_PEM', + mergedSettings.ALLOW_DEVICE_TO_PROVIDE_PEM, + ); + + // Repository + container.bindClass( + 'IDeviceAttributeRepository', + DeviceAttributeFileRepository, + ['DEVICE_DIRECTORY'], + ); + + container.bindClass('IDeviceKeyRepository', DeviceKeyFileRepository, [ + 'DEVICE_DIRECTORY', + ]); + container.bindClass('IProductDeviceRepository', MockProductDeviceRepository); + container.bindClass( + 'IProductFirmwareRepository', + MockProductFirmwareRepository, + ); + + container.bindClass('ServerKeyRepository', ServerKeyFileRepository, [ + 'SERVER_KEYS_DIRECTORY', + 'SERVER_KEY_FILENAME', + ]); + + // Utils + container.bindClass('EventPublisher', EventPublisher, []); + container.bindClass('EVENT_PROVIDER', EventProvider, ['EventPublisher']); + container.bindClass('ClaimCodeManager', ClaimCodeManager, []); + container.bindClass('CryptoManager', CryptoManager, [ + 'IDeviceKeyRepository', + 'ServerKeyRepository', + 'SERVER_KEY_PASSWORD', + ]); + + // Device server + container.bindClass('DeviceServer', DeviceServer, [ + 'IDeviceAttributeRepository', + 'IProductDeviceRepository', + 'IProductFirmwareRepository', + 'ClaimCodeManager', + 'CryptoManager', + 'EventPublisher', + 'TCP_DEVICE_SERVER_CONFIG', + 'ENABLE_SYSTEM_FIRWMARE_AUTOUPDATES', + 'CONNECTED_DEVICES_LOGGING_INTERVAL', + 'ALLOW_DEVICE_TO_PROVIDE_PEM', + ]); +}; + +export default defaultBindings; diff --git a/packages/spark-protocol/src/filterFalsyValues.ts b/packages/spark-protocol/src/filterFalsyValues.ts new file mode 100644 index 00000000..d36a9d03 --- /dev/null +++ b/packages/spark-protocol/src/filterFalsyValues.ts @@ -0,0 +1,3 @@ +export function filterFalsyValues(value: T): value is NonNullable { + return value != null; +} diff --git a/packages/spark-protocol/src/global.d.ts b/packages/spark-protocol/src/global.d.ts new file mode 100644 index 00000000..0cbe48f3 --- /dev/null +++ b/packages/spark-protocol/src/global.d.ts @@ -0,0 +1,137 @@ +declare module 'moniker' { + class Generator { + choose: () => string; + } + const adjective = 'adjective'; + const noun = 'noun'; + function generator(params: (adjective | noun)[]): Generator; +} +declare module 'ec-key' { + class ECKey { + constructor(key: string, keyType: 'pem'); + createSign(hash: string): Sign & { + sign: (format?: BinaryToTextEncoding) => Buffer; + }; + toString(format: string): string; + } + export = ECKey; +} +declare module 'constitute' { + class Container { + bindValue: (key: string, value: unknown) => void; + + // eslint-disable-next-line @typescript-eslint/ban-types + bindClass: (key: string, clazz: Function, dependencies?: string[]) => void; + } +} +declare module 'binary-version-reader' { + enum PlatformType { + Core = 0, + Photon = 6, + P1 = 8, + Electron = 10, + Argon = 12, + Boron = 13, + Xenon = 14, + RaspberryPI = 31, + Duo = 88, + Bluz = 103, + } + + type ModuleFunction = 2 | 4 | 5; + type FirmwarePrefixInfo = { + moduleStartAddy: string; + moduleEndAddy: string; + reserved: number; + moduleFlags: number; + moduleVersion: number; + platformID: number; + moduleFunction: ModuleFunction; + moduleIndex: number; + depModuleFunction: ModuleFunction; + depModuleIndex: number; + depModuleVersion: number; + dep2ModuleFunction: ModuleFunction; + dep2ModuleIndex: number; + dep2ModuleVersion: number; + prefixOffset: number; + }; + type FirmwareSetting = { + filename: string; + crc: { + ok: boolean; + storedCrc: string; + actualCrc: string; + }; + prefixInfo: FirmwarePrefixInfo; + suffixInfo: { + productId: number; + productVersion: number; + fwUniqueId: string; + reserved: number; + suffixSize: number; + crcBlock: string; + }; + }; + + type ModuleSubDependency = { + f: string; + n: string; + v: number; + _?: string; + }; + type ModuleDependency = { + s: number; + l: 'm' | 'f'; + vc: number; + vv: number; + u?: string; + f?: 'b' | 's' | 'u'; + n?: string; + v?: number; + d: ModuleSubDependency[]; + }; + type SystemInformation = { + f: []; + v: Record; + p: PlatformType; + m: ModuleDependency[]; + }; + + class HalModuleParser { + parseFile: ( + result: string, + callback: (ret: FirmwareSetting, error: Error | undefined) => void, + ) => void; + } + + class HalDependencyResolver { + findAnyMissingDependencies: ( + systemInformation: SystemInformation, + ) => ModuleDependency[]; + } + class HalDescribeParser { + getModules: (systemInformation: SystemInformation) => FirmwareModule[]; + } + class FirmwareModule { + constructor(moduleDependency: ModuleDependency); + hasIntegrity: () => boolean; + + toDescribe: () => ModuleDependency; + + areDependenciesMet: ( + systemModule: SystemModule, + foo: FirmwareModule[], + ) => boolean; + + func: ModuleDependency['f']; + + version: number; + + name: string; + + filename: string; + + uuid: string; + } +} diff --git a/packages/spark-protocol/src/index.ts b/packages/spark-protocol/src/index.ts new file mode 100644 index 00000000..cbaa81db --- /dev/null +++ b/packages/spark-protocol/src/index.ts @@ -0,0 +1,14 @@ +export { default as DeviceAttributeFileRepository } from './repository/DeviceAttributeFileRepository'; +export { default as DeviceKeyFileRepository } from './repository/DeviceKeyFileRepository'; +export { default as ClaimCodeManager } from './lib/ClaimCodeManager'; +export { default as EventPublisher } from './lib/EventPublisher'; +export { default as DeviceServer } from './server/DeviceServer'; +export { default as FileManager } from './repository/FileManager'; +export { default as JSONFileManager } from './repository/JSONFileManager'; +export { default as ServerKeyFileRepository } from './repository/ServerKeyFileRepository'; +export { default as Device } from './clients/Device'; +export { default as defaultBindings } from './defaultBindings'; +export { default as SPARK_SERVER_EVENTS } from './lib/SparkServerEvents'; +export { filterFalsyValues } from './filterFalsyValues'; +export { default as SETTINGS, Settings } from './settings'; +export * from './types'; diff --git a/packages/spark-protocol/src/lib/BufferStream.ts b/packages/spark-protocol/src/lib/BufferStream.ts new file mode 100644 index 00000000..27b90948 --- /dev/null +++ b/packages/spark-protocol/src/lib/BufferStream.ts @@ -0,0 +1,40 @@ +class BufferStream { + _buffer: Buffer | null | undefined; + + _index: number = 0; + + constructor(buffer: Buffer) { + this._buffer = buffer; + } + + seek(index: number) { + this._index = index; + } + + read(size?: number): Buffer | null | undefined { + if (!this._buffer) { + return null; + } + + const index = this._index; + let endIndex = index + (size || 0); + + if (endIndex >= this._buffer.length) { + endIndex = this._buffer.length; + } + + let result = null; + if (endIndex - index > 0) { + result = this._buffer.slice(index, endIndex); + this._index = endIndex; + } + + return result; + } + + close() { + this._buffer = null; + } +} + +export default BufferStream; diff --git a/packages/spark-protocol/src/lib/ChunkingStream.ts b/packages/spark-protocol/src/lib/ChunkingStream.ts new file mode 100644 index 00000000..7a0b591e --- /dev/null +++ b/packages/spark-protocol/src/lib/ChunkingStream.ts @@ -0,0 +1,125 @@ +import { Transform } from 'stream'; +import Logger from './logger'; +const logger = Logger.createModuleLogger(module); + +/** + Our job here is to accept messages in whole chunks, and put their length in front + as we send them out, and parse them back into those size chunks as we read them in. + * */ +/* eslint-disable no-bitwise */ + +const MSG_LENGTH_BYTES = 2; +const messageLengthBytes = ( + message: Buffer | string, +): Buffer | null | undefined => { + // assuming a maximum encrypted message length of 65K, lets write an + // unsigned short int before every message, so we know how much to read out. + const { length } = message; + const lengthBuffer = Buffer.alloc(MSG_LENGTH_BYTES); + + lengthBuffer[0] = length >>> 8; + lengthBuffer[1] = length & 255; + + return lengthBuffer; +}; + +type ChunkingStreamOptions = { + outgoing?: boolean; +}; + +class ChunkingStream extends Transform { + _combinedBuffer: Buffer | null | undefined = null; + + _currentOffset: number = 0; + + _options: ChunkingStreamOptions; + + constructor(options: ChunkingStreamOptions) { + super(); + + this._options = options; + } + + _transform(buffer: Buffer | string, encoding: string, callback: () => void) { + if (this._options.outgoing) { + this._processOutput(buffer, encoding, callback); + } else { + this._processInput(buffer, encoding, callback); + } + } + + _processOutput( + buffer: Buffer | string, + encoding: string, + callback: () => void, + ) { + const tempBuffer = + typeof buffer === 'string' ? Buffer.from(buffer) : buffer; + + const lengthChunk = messageLengthBytes(tempBuffer); + this.push( + Buffer.concat(lengthChunk ? [lengthChunk, tempBuffer] : [tempBuffer]), + ); + process.nextTick(callback); + } + + _processInput( + buffer: Buffer | string, + encoding: string, + callback: () => void, + ) { + try { + let copyStart = 0; + const tempBuffer: Buffer = + typeof buffer === 'string' ? Buffer.from(buffer) : buffer; + + if (this._combinedBuffer === null) { + const expectedLength: number = + (tempBuffer[0] << 8) + parseInt(buffer[1].toString(), 10); + this._combinedBuffer = Buffer.alloc(expectedLength); + this._currentOffset = 0; + copyStart = 2; + } + + const combinedBuffer = this._combinedBuffer; + if (combinedBuffer == null) { + return; + } + + const copyEnd = Math.min( + buffer.length, + combinedBuffer.length - this._currentOffset + copyStart, + ); + + this._currentOffset += tempBuffer.copy( + combinedBuffer, + this._currentOffset, + copyStart, + copyEnd, + ); + + if (this._currentOffset !== combinedBuffer.length) { + process.nextTick(callback); + return; + } + + this.push(combinedBuffer); + this._combinedBuffer = null; + + if (tempBuffer.length <= copyEnd) { + process.nextTick(callback); + return; + } + + const remainder = buffer.slice(copyEnd); + process.nextTick((): void => + this._processInput(remainder, encoding, callback), + ); + } catch (error) { + logger.error({ err: error }, 'ChunkingStream error!'); + process.nextTick(callback); + } + } +} + +export default ChunkingStream; diff --git a/packages/spark-protocol/src/lib/ClaimCodeManager.ts b/packages/spark-protocol/src/lib/ClaimCodeManager.ts new file mode 100644 index 00000000..33f3189d --- /dev/null +++ b/packages/spark-protocol/src/lib/ClaimCodeManager.ts @@ -0,0 +1,60 @@ +import crypto from 'crypto'; + +const CLAIM_CODE_LENGTH = 63; +const CLAIM_CODE_TTL = 5000 * 60; // 5 min + +class ClaimCodeManager { + _userIDByClaimCode: Map = new Map(); + + _timers: Map = new Map(); + + _generateClaimCode(): string { + return crypto + .randomBytes(CLAIM_CODE_LENGTH) + .toString('base64') + .substring(0, CLAIM_CODE_LENGTH); + } + + createClaimCode(userID: string): string { + let claimCode = this._generateClaimCode(); + + while (this._userIDByClaimCode.has(claimCode)) { + claimCode = this._generateClaimCode(); + } + + this._userIDByClaimCode.set(claimCode, userID); + + this._timers.set( + claimCode, + setTimeout( + (): boolean => this.removeClaimCode(claimCode), + CLAIM_CODE_TTL, + ), + ); + + return claimCode; + } + + onShutdown(): void { + const timers = Array.from(this._timers.values()); + timers.forEach((timer) => { + clearTimeout(timer); + }); + this._timers.clear(); + } + + removeClaimCode(claimCode: string): boolean { + const timer = this._timers.get(claimCode); + if (timer) { + clearTimeout(timer); + } + this._timers.delete(claimCode); + return this._userIDByClaimCode.delete(claimCode); + } + + getUserIDByClaimCode(claimCode: string): string | null | undefined { + return this._userIDByClaimCode.get(claimCode); + } +} + +export default ClaimCodeManager; diff --git a/packages/spark-protocol/src/lib/CoapMessage.ts b/packages/spark-protocol/src/lib/CoapMessage.ts new file mode 100644 index 00000000..4060caae --- /dev/null +++ b/packages/spark-protocol/src/lib/CoapMessage.ts @@ -0,0 +1,71 @@ +export type CoapMessageTypes = 0 | 1 | 2 | 3; + +const CODES = Object.freeze({ + EMPTY: 0.0, + GET: 0.01, + POST: 0.02, + PUT: 0.03, + DELETE: 0.04, + OK: 2.0, + CREATED: 2.01, + DELETED: 2.02, + NOT_MODIFIED: 2.03, + CHANGED: 2.04, + CONTENT: 2.05, + BAD_REQUEST: 4, + UNAUTHORIZED: 4.01, + BAD_OPTION: 4.02, + FORBIDDEN: 4.03, + NOT_FOUND: 4.04, + METHOD_NOT_ALLOWED: 4.05, + NOT_ACCEPTABLE: 4.06, + REQUEST_ENTITY_INCOMPLETE: 136, + PRECONDITION_FAILED: 4.12, + REQUEST_ENTITY_TOO_LARGE: 4.13, + UNSUPPORTED_CONTENT_FORMAT: 4.15, + INTERNAL_SERVER_ERROR: 5, + NOT_IMPLEMENTED: 5.01, + BAD_GATEWAY: 5.02, + SERVICE_UNAVAILABLE: 5.03, + GATEWAY_TIMEOUT: 5.04, + PROXYING_NOT_SUPPORTED: 5.05, +}); + +const OPTIONS = Object.freeze({ + ACCEPT: 'Accept', + BLOCK1: 'Block1', + BLOCK2: 'Block2', + CONTENT_FORMAT: 'Content-Format', + ETAG: 'ETag', + If_MATCH: 'If-Match', + IF_NONE_MATCH: 'If-None-Match', + LOCATION_PATH: 'Location-Path', + LOCATION_QUERY: 'Location-Query', + MAX_AGE: 'Max-Age', + OBSERVE: 'Observe', + PROXY_SCHEME: 'Proxy-Scheme', + PROXY_URI: 'Proxy-Uri', + SIZE1: 'Size1', + URI_HOST: 'Uri-Host', + URI_PATH: 'Uri-Path', + URI_PORT: 'Uri-Port', + URI_QUERY: 'Uri-Query', +}); + +const TYPES = Object.freeze({ + CON: 0, + NON: 1, + ACK: 2, + RST: 3, + ERROR: 4, +}); + +class CoapMessage { + static Code: typeof CODES = CODES; + + static Option: typeof OPTIONS = OPTIONS; + + static Type: typeof TYPES = TYPES; +} + +export default CoapMessage; diff --git a/packages/spark-protocol/src/lib/CoapMessages.ts b/packages/spark-protocol/src/lib/CoapMessages.ts new file mode 100644 index 00000000..e2d66db3 --- /dev/null +++ b/packages/spark-protocol/src/lib/CoapMessages.ts @@ -0,0 +1,432 @@ +import type { ParsedPacket, Option, NamedOption } from 'coap-packet'; +import CoapPacket from 'coap-packet'; +import type { CoapMessageTypes } from './CoapMessage'; +import type { + MessageSpecificationType, + MessageType, +} from './MessageSpecifications'; + +import CoapMessage from './CoapMessage'; +import MessageSpecifications from './MessageSpecifications'; +import Logger from './logger'; +import { filterFalsyValues } from '../filterFalsyValues'; +const logger = Logger.createModuleLogger(module); + +const getRouteKey = (code: number | string, path: string): string => { + const uri = code + path; + const idx = uri.indexOf('/'); + + // this assumes all the messages are one character for now. + // if we wanted to change this, we'd need to find the first non message char, + // '/' or '?', or use the real coap parsing stuff + return uri.substr(0, idx + 2); +}; +const messageTypeToPacketProps = ( + type: CoapMessageTypes, +): { + ack: boolean; + confirmable: boolean; + reset: boolean; +} => { + const output = { + ack: false, + confirmable: false, + reset: false, + }; + const types = CoapMessage.Type; + if (type === types.ACK) { + output.ack = true; + } else if (type === types.CON) { + output.confirmable = true; + } else if (type === types.RST) { + output.reset = true; + } + + return output; +}; + +const decodeNumericValue = (buffer: Buffer): number => { + const { length } = buffer; + if (length === 0) { + return 0; + } + if (length === 1) { + return buffer[0]; + } + if (length === 2) { + return buffer.readUInt16BE(0); + } + if (length === 3) { + /* eslint-disable no-bitwise */ + return (buffer[1] << 8) | (buffer[2] + ((buffer[0] << 16) >>> 0)); + /* eslint-enable no-bitwise */ + } + + return buffer.readUInt32BE(0); +}; + +class CoapMessages { + static _specifications: Map = new Map( + MessageSpecifications, + ); + + // Maps CODE + URL to MessageNames as they appear in 'Spec' + static _routes: Map = new Map( + MessageSpecifications.filter( + // eslint-disable-next-line no-unused-vars + ([_name, value]): boolean => !!value.uri, + ).map(([name, value]): [string, MessageType] => { + // see what it looks like without params + const uri = value.template ? value.template.render({}) : value.uri; + const routeKey = getRouteKey(value.code, `/${uri || ''}`); + + return [routeKey, name]; + }), + ); + + static getUriPath(packet: ParsedPacket): string { + const options = (packet.options || []).filter( + (item): boolean => item.name === CoapMessage.Option.URI_PATH, + ); + + if (!options.length) { + return ''; + } + + return `/${options + .map((item): string => item.value.toString('utf8')) + .join('/')}`; + } + + static getUriQuery(packet: ParsedPacket): string { + return (packet.options || []) + .filter((item): boolean => item.name === CoapMessage.Option.URI_QUERY) + .map((item): string => item.value.toString('utf8')) + .join('&'); + } + + static getMaxAge(packet: ParsedPacket): number { + const option = (packet.options || []).find( + (item): boolean => item.name === CoapMessage.Option.MAX_AGE, + ); + + if (!option) { + return 0; + } + + return decodeNumericValue(option.value); + } + + static getRequestType(packet: ParsedPacket): MessageType | undefined { + const uri = getRouteKey(packet.code, CoapMessages.getUriPath(packet)); + + return CoapMessages._routes.get(uri); + } + + static getResponseType(name: MessageType): string | null | undefined { + const specification = CoapMessages._specifications.get(name); + return specification?.response; + } + + static statusIsOkay(message: ParsedPacket): boolean { + return parseFloat(message.code) < CoapMessage.Code.BAD_REQUEST; + } + + static isNonTypeMessage(messageName: MessageType): boolean { + const specification = CoapMessages._specifications.get(messageName); + if (!specification) { + return false; + } + + return specification.type === CoapMessage.Type.NON; + } + + static wrap( + messageName: MessageType, + messageId: number, + params?: { + args?: Array | Array; + name?: string; + event_name?: string; + } | null, + options?: Array