diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 767e999..0074497 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -21,11 +21,11 @@ jobs: - name: Publish if version has been updated uses: pascalgn/npm-publish-action@1.3.7 with: - tag_name: "v%s" - tag_message: "v%s" - create_tag: "true" + tag_name: 'v%s' + tag_message: 'v%s' + create_tag: 'true' commit_pattern: "^Release (\\S+)" - publish_args: "--non-interactive" + publish_args: '--non-interactive' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.gitignore b/.gitignore index 487f17e..dd8ff85 100644 --- a/.gitignore +++ b/.gitignore @@ -80,7 +80,6 @@ typings/ # Nuxt.js build / generate output .nuxt -dist # Gatsby files .cache/ @@ -103,5 +102,5 @@ dist # TernJS port file .tern-port -testing/ -/lib/ \ No newline at end of file +/lib/ +/test/ \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f288702..0000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f5a0171 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,675 @@ +### GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +### Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program--to make sure it remains +free software for all its users. We, the Free Software Foundation, use +the GNU General Public License for most of our software; it applies +also to any other work released this way by its authors. You can apply +it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + +### TERMS AND CONDITIONS + +#### 0. Definitions. + +"This License" refers to version 3 of the GNU General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a "modified version" of +the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays "Appropriate Legal Notices" to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +#### 1. Source Code. + +The "source code" for a work means the preferred form of the work for +making modifications to it. "Object code" means any non-source form of +a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +#### 2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 makes +it unnecessary. + +#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +#### 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +#### 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +- a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in section 4 + to "keep intact all notices". +- c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +#### 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +- a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the Corresponding + Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +- d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the general + public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +"normally used" refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +#### 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +- a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors + or authors of the material; or +- e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions + of it) with contractual assumptions of liability to the recipient, + for any liability that these contractual assumptions directly + impose on those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +#### 8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +#### 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +#### 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +#### 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +#### 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree to +terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +#### 13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +#### 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If the +Program does not specify a version number of the GNU General Public +License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +#### 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +#### 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +#### 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands \`show w' and \`show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + +The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . diff --git a/README.md b/README.md index 668434b..3c9a401 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,12 @@ -Trixi is a WebSocket wrapper that enables developers to create better and stricter acpplications. The way we do this is that we use scoped socket interactions which allows you to have a scope for unidirectional payloads, operator based payloads, and bidirectional payloads. All of this is done through the use of a standardized payload schema. +Trixi is a WebSocket wrapper that enables developers to create better and stricter acpplications. The way we do this is that we use scoped socket interactions which allows you to have a scope for unidirectional payloads, operator based payloads, and bidirectional payloads. All of this is done through the use of a standardized payload schema. # Unidirectional Payloads -If you need to send a payload with out the possibility of a response, then you can send a unidirectional payload, otherwise knon as an assertion. Both the client and server can send an assertion to each other, once the assertion is sent, it cannot be replied to in any way. + +If you need to send a payload with out the possibility of a response, then you can send a unidirectional payload, otherwise knon as an assertion. Both the client and server can send an assertion to each other, once the assertion is sent, it cannot be replied to in any way. + ```ts import trixi from 'trixi'; import { Server } from 'http'; @@ -27,34 +29,39 @@ const app = trixi(); * Server Example */ httpServer.listen(8080, () => { - const server = app.createServer({ httpServer }); - - server.onConnection(connection => { - console.log("A new socket connection has been established from", connection.remoteAddress); - - // Send your assertion message on start - connection.assert("Welcome..."); - - // Create a listener for assertions from the client - connection.onAssert(assertion => { - console.log("New assertion from client:", assertion.data); - }); - }); + const server = app.createServer({ httpServer }); + + server.onConnection((connection) => { + console.log( + 'A new socket connection has been established from', + connection.remoteAddress + ); + + // Send your assertion message on start + connection.assert('Welcome...'); + + // Create a listener for assertions from the client + connection.onAssert((assertion) => { + console.log('New assertion from client:', assertion.data); + }); + }); }); /** * Client Example */ -const client = app.createClient({ url: "ws://localhost:8080" }); -client.assert("I have arrived!!"); +const client = app.createClient({ url: 'ws://localhost:8080' }); +client.assert('I have arrived!!'); -client.onAssert(assertion => { - console.log("New assertion from server:", assertion.data); +client.onAssert((assertion) => { + console.log('New assertion from server:', assertion.data); }); ``` # Bidirectional Payloads -Sometimes you want to be able to hear back from your client when you send a message, so with bidirectional payloads, you'll be able to send a payload, and recieve payload in response if you so choose. When you response, it will be sent directionally to the original payload which you can start a listener for a response on. + +Sometimes you want to be able to hear back from your client when you send a message, so with bidirectional payloads, you'll be able to send a payload, and recieve payload in response if you so choose. When you response, it will be sent directionally to the original payload which you can start a listener for a response on. + ```ts import trixi from 'trixi'; import { Server } from 'http'; @@ -66,34 +73,39 @@ const app = trixi(); * Server Example */ httpServer.listen(8080, () => { - const server = app.createServer({ httpServer }); - - server.onConnection(connection => { - console.log("A new socket connection has been established from", connection.remoteAddress); - - // Create your listener - connection.onPayload(msg => { - console.log("Recieved a payload from the client", msg.data); - msg.reply({ recieved: true }); - }) - }); + const server = app.createServer({ httpServer }); + + server.onConnection((connection) => { + console.log( + 'A new socket connection has been established from', + connection.remoteAddress + ); + + // Create your listener + connection.onPayload((msg) => { + console.log('Recieved a payload from the client', msg.data); + msg.reply({ recieved: true }); + }); + }); }); /** * Client Example */ -const client = app.createClient({ url: "ws://localhost:8080" }); +const client = app.createClient({ url: 'ws://localhost:8080' }); // Send a message to the server and await a response -client.send({ hello: "world" }).then(payload => { - payload.onResponse(response => { - console.log("Recieved response from the server", response.data); - }) +client.send({ hello: 'world' }).then((payload) => { + payload.onResponse((response) => { + console.log('Recieved response from the server', response.data); + }); }); ``` # Operator Payloads -Operator payloads are something that you can use to send a payload with a specific operator code attached to it. Once you send the operator payload, the client can listen for it and if it choose to, it can reply in the same manor as the bidrectional payload. + +Operator payloads are something that you can use to send a payload with a specific operator code attached to it. Once you send the operator payload, the client can listen for it and if it choose to, it can reply in the same manor as the bidrectional payload. + ```ts import trixi from 'trixi'; import { Server } from 'http'; @@ -105,25 +117,28 @@ const app = trixi(); * Server Example */ httpServer.listen(8080, () => { - const server = app.createServer({ httpServer }); + const server = app.createServer({ httpServer }); - server.onConnection(connection => { - console.log("A new socket connection has been established from", connection.remoteAddress); + server.onConnection((connection) => { + console.log( + 'A new socket connection has been established from', + connection.remoteAddress + ); - // When a new connection is established, send the "hello:world" operator. - connection.sendOp("hello:world", { greeting: "Hello World" }); - }); + // When a new connection is established, send the "hello:world" operator. + connection.sendOp('hello:world', { greeting: 'Hello World' }); + }); }); /** * Client Example */ -const client = app.createClient({ url: "ws://localhost:8080" }); +const client = app.createClient({ url: 'ws://localhost:8080' }); // Create a listener on the operator "hello:world" -client.onOp("hello:world", e => { - console.log("New message on 'hello:world':", e.data); +client.onOp('hello:world', (e) => { + console.log("New message on 'hello:world':", e.data); }); ``` -> **NOTE**: You can send a string or a json object as a payload. \ No newline at end of file +> **NOTE**: You can send a string or a json object as a payload. diff --git a/dist/trixi.js b/dist/trixi.js new file mode 100644 index 0000000..75bf773 --- /dev/null +++ b/dist/trixi.js @@ -0,0 +1,1926 @@ +var trixi; +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 659: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createClient = void 0; +var eventra_1 = __webpack_require__(825); +var uuid = __importStar(__webpack_require__(614)); +var collection_1 = __importDefault(__webpack_require__(436)); +var websocket_1 = __webpack_require__(840); +function createClient(options) { + var _a; + var isOpen = false; + var url = options.url; + var origin = options.origin; + var headers = (_a = options.headers) !== null && _a !== void 0 ? _a : {}; + var wse = new eventra_1.Eventra(); + var ws = new websocket_1.w3cwebsocket(url, 'echo-protocol', origin); + ws.onopen = function open() { + isOpen = true; + wse.emit('open'); + return; + }; + ws.onclose = function close() { + isOpen = false; + wse.emit('close'); + return; + }; + ws.onerror = function error(error) { + throw error; + }; + ws.onmessage = function incomming(event) { + var interaction = JSON.parse(event.data.toString()); + wse.emit('interaction', interaction); + }; + function assebleHeaders() { + var headers = []; + for (var _i = 0; _i < arguments.length; _i++) { + headers[_i] = arguments[_i]; + } + var finalHeaders = {}; + headers.forEach(function (header) { + finalHeaders = Object.assign(finalHeaders, header); + }); + return finalHeaders; + } + var _responseListeners = new collection_1.default(); + wse.on('interaction', function (interaction) { + _responseListeners.map(function (callback, reference) { + var _a; + if (reference === interaction.reference) { + _responseListeners.delete(reference); + if ((_a = interaction.operator) === null || _a === void 0 ? void 0 : _a.startsWith('ERROR')) { + var error = new Error("(" + interaction.data.error.code + "): " + interaction.data.error.message); + return callback(interaction, error); + } + return callback(interaction, null); + } + }); + }); + function awaitResponse(reference, callback) { + _responseListeners.set(reference, callback); + } + return { + ws: ws, + on: wse.on, + once: wse.once, + addListener: wse.addListener, + listeners: wse.listeners, + prependListener: wse.prependListener, + prependOnceListener: wse.prependOnceListener, + send: function (dispatch, callback) { + var _a, _b; + var data = dispatch.data; + var uri = dispatch.uri; + var method = dispatch.method; + var reference = (_a = dispatch.reference) !== null && _a !== void 0 ? _a : uuid.v4(); + var payloadData = { + uri: uri, + data: data, + headers: assebleHeaders(headers, ((_b = dispatch.headers) !== null && _b !== void 0 ? _b : {})), + method: method, + reference: reference + }; + var dataString = JSON.stringify(payloadData); + if (!isOpen) + wse.on('open', function () { return ws.send(dataString); }); + else + ws.send(dataString); + awaitResponse(reference, callback); + } + }; +} +exports.createClient = createClient; + + +/***/ }), + +/***/ 436: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Collection = void 0; +/** + * A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has + * an ID, for significantly improved performance and ease-of-use. + * @extends {Map} + * @property {number} size - The amount of elements in this collection. + */ +class Collection extends Map { + /** + * Identical to [Map.get()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get). + * Gets an element with the specified key, and returns its value, or `undefined` if the element does not exist. + * @param {*} key - The key to get from this collection + * @returns {* | undefined} + */ + get(key) { + return super.get(key); + } + /** + * Identical to [Map.set()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set). + * Sets a new element in the collection with the specified key and value. + * @param {*} key - The key of the element to add + * @param {*} value - The value of the element to add + * @returns {Collection} + */ + set(key, value) { + return super.set(key, value); + } + /** + * Identical to [Map.has()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has). + * Checks if an element exists in the collection. + * @param {*} key - The key of the element to check for + * @returns {boolean} `true` if the element exists, `false` if it does not exist. + */ + has(key) { + return super.has(key); + } + /** + * Identical to [Map.delete()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete). + * Deletes an element from the collection. + * @param {*} key - The key to delete from the collection + * @returns {boolean} `true` if the element was removed, `false` if the element does not exist. + */ + delete(key) { + return super.delete(key); + } + /** + * Identical to [Map.clear()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear). + * Removes all elements from the collection. + * @returns {undefined} + */ + clear() { + return super.clear(); + } + /** + * Checks if all of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if all of the elements exist, `false` if at least one does not exist. + */ + hasAll(...keys) { + return keys.every((k) => super.has(k)); + } + /** + * Checks if any of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if any of the elements exist, `false` if none exist. + */ + hasAny(...keys) { + return keys.some((k) => super.has(k)); + } + first(amount) { + if (typeof amount === 'undefined') + return this.values().next().value; + if (amount < 0) + return this.last(amount * -1); + amount = Math.min(this.size, amount); + const iter = this.values(); + return Array.from({ length: amount }, () => iter.next().value); + } + firstKey(amount) { + if (typeof amount === 'undefined') + return this.keys().next().value; + if (amount < 0) + return this.lastKey(amount * -1); + amount = Math.min(this.size, amount); + const iter = this.keys(); + return Array.from({ length: amount }, () => iter.next().value); + } + last(amount) { + const arr = [...this.values()]; + if (typeof amount === 'undefined') + return arr[arr.length - 1]; + if (amount < 0) + return this.first(amount * -1); + if (!amount) + return []; + return arr.slice(-amount); + } + lastKey(amount) { + const arr = [...this.keys()]; + if (typeof amount === 'undefined') + return arr[arr.length - 1]; + if (amount < 0) + return this.firstKey(amount * -1); + if (!amount) + return []; + return arr.slice(-amount); + } + random(amount) { + const arr = [...this.values()]; + if (typeof amount === 'undefined') + return arr[Math.floor(Math.random() * arr.length)]; + if (!arr.length || !amount) + return []; + return Array.from({ length: Math.min(amount, arr.length) }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); + } + randomKey(amount) { + const arr = [...this.keys()]; + if (typeof amount === 'undefined') + return arr[Math.floor(Math.random() * arr.length)]; + if (!arr.length || !amount) + return []; + return Array.from({ length: Math.min(amount, arr.length) }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); + } + find(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (fn(val, key, this)) + return val; + } + return undefined; + } + findKey(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (fn(val, key, this)) + return key; + } + return undefined; + } + sweep(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const previousSize = this.size; + for (const [key, val] of this) { + if (fn(val, key, this)) + this.delete(key); + } + return previousSize - this.size; + } + filter(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const results = new this.constructor[Symbol.species](); + for (const [key, val] of this) { + if (fn(val, key, this)) + results.set(key, val); + } + return results; + } + partition(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const results = [ + new this.constructor[Symbol.species](), + new this.constructor[Symbol.species](), + ]; + for (const [key, val] of this) { + if (fn(val, key, this)) { + results[0].set(key, val); + } + else { + results[1].set(key, val); + } + } + return results; + } + flatMap(fn, thisArg) { + const collections = this.map(fn, thisArg); + return new this.constructor[Symbol.species]().concat(...collections); + } + map(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const iter = this.entries(); + return Array.from({ length: this.size }, () => { + const [key, value] = iter.next().value; + return fn(value, key, this); + }); + } + mapValues(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const coll = new this.constructor[Symbol.species](); + for (const [key, val] of this) + coll.set(key, fn(val, key, this)); + return coll; + } + some(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (fn(val, key, this)) + return true; + } + return false; + } + every(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (!fn(val, key, this)) + return false; + } + return true; + } + /** + * Applies a function to produce a single value. Identical in behavior to + * [Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce). + * @param {Function} fn Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`, + * and `collection` + * @param {*} [initialValue] Starting value for the accumulator + * @returns {*} + * @example collection.reduce((acc, guild) => acc + guild.memberCount, 0); + */ + reduce(fn, initialValue) { + let accumulator; + if (typeof initialValue !== 'undefined') { + accumulator = initialValue; + for (const [key, val] of this) + accumulator = fn(accumulator, val, key, this); + return accumulator; + } + let first = true; + for (const [key, val] of this) { + if (first) { + accumulator = val; + first = false; + continue; + } + accumulator = fn(accumulator, val, key, this); + } + // No items iterated. + if (first) { + throw new TypeError('Reduce of empty collection with no initial value'); + } + return accumulator; + } + each(fn, thisArg) { + this.forEach(fn, thisArg); + return this; + } + tap(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + fn(this); + return this; + } + /** + * Creates an identical shallow copy of this collection. + * @returns {Collection} + * @example const newColl = someColl.clone(); + */ + clone() { + return new this.constructor[Symbol.species](this); + } + /** + * Combines this collection with others into a new collection. None of the source collections are modified. + * @param {...Collection} collections Collections to merge + * @returns {Collection} + * @example const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl); + */ + concat(...collections) { + const newColl = this.clone(); + for (const coll of collections) { + for (const [key, val] of coll) + newColl.set(key, val); + } + return newColl; + } + /** + * Checks if this collection shares identical items with another. + * This is different to checking for equality using equal-signs, because + * the collections may be different objects, but contain the same data. + * @param {Collection} collection Collection to compare with + * @returns {boolean} Whether the collections have identical contents + */ + equals(collection) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!collection) + return false; // runtime check + if (this === collection) + return true; + if (this.size !== collection.size) + return false; + for (const [key, value] of this) { + if (!collection.has(key) || value !== collection.get(key)) { + return false; + } + } + return true; + } + /** + * The sort method sorts the items of a collection in place and returns it. + * The sort is not necessarily stable in Node 10 or older. + * The default sort order is according to string Unicode code points. + * @param {Function} [compareFunction] Specifies a function that defines the sort order. + * If omitted, the collection is sorted according to each character's Unicode code point value, + * according to the string conversion of each element. + * @returns {Collection} + * @example collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); + */ + sort(compareFunction = Collection.defaultSort) { + const entries = [...this.entries()]; + entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0])); + // Perform clean-up + super.clear(); + // Set the new entries + for (const [k, v] of entries) { + super.set(k, v); + } + return this; + } + /** + * The intersect method returns a new structure containing items where the keys are present in both original structures. + * @param {Collection} other The other Collection to filter against + * @returns {Collection} + */ + intersect(other) { + const coll = new this.constructor[Symbol.species](); + for (const [k, v] of other) { + if (this.has(k)) + coll.set(k, v); + } + return coll; + } + /** + * The difference method returns a new structure containing items where the key is present in one of the original structures but not the other. + * @param {Collection} other The other Collection to filter against + * @returns {Collection} + */ + difference(other) { + const coll = new this.constructor[Symbol.species](); + for (const [k, v] of other) { + if (!this.has(k)) + coll.set(k, v); + } + for (const [k, v] of this) { + if (!other.has(k)) + coll.set(k, v); + } + return coll; + } + /** + * The sorted method sorts the items of a collection and returns it. + * The sort is not necessarily stable in Node 10 or older. + * The default sort order is according to string Unicode code points. + * @param {Function} [compareFunction] Specifies a function that defines the sort order. + * If omitted, the collection is sorted according to each character's Unicode code point value, + * according to the string conversion of each element. + * @returns {Collection} + * @example collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); + */ + sorted(compareFunction = Collection.defaultSort) { + return new this.constructor[Symbol.species](this).sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk)); + } + static defaultSort(firstValue, secondValue) { + return Number(firstValue > secondValue) || Number(firstValue === secondValue) - 1; + } +} +exports.Collection = Collection; +Collection.default = Collection; +exports.default = Collection; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiL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PFY+KGZpcnN0VmFsdWU6IFYsIHNlY29uZFZhbHVlOiBWKTogbnVtYmVyIHtcblx0XHRyZXR1cm4gTnVtYmVyKGZpcnN0VmFsdWUgPiBzZWNvbmRWYWx1ZSkgfHwgTnVtYmVyKGZpcnN0VmFsdWUgPT09IHNlY29uZFZhbHVlKSAtIDE7XG5cdH1cbn1cblxuZXhwb3J0IHR5cGUgQ29tcGFyYXRvcjxLLCBWPiA9IChmaXJzdFZhbHVlOiBWLCBzZWNvbmRWYWx1ZTogViwgZmlyc3RLZXk6IEssIHNlY29uZEtleTogSykgPT4gbnVtYmVyO1xuXG5leHBvcnQgZGVmYXVsdCBDb2xsZWN0aW9uO1xuIl19 + +/***/ }), + +/***/ 825: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Eventra = void 0; +const ListenerArray_1 = __importDefault(__webpack_require__(400)); +class Eventra { + constructor() { + this._listeners = new ListenerArray_1.default({ mode: "recurring" }); + this._singularListeners = new ListenerArray_1.default({ mode: "once" }); + this.addListener = this.on; + this.off = this.removeListener; + } + emit(event, ...args) { + this._listeners.executeEvent(event, ...args); + this._singularListeners.executeEvent(event, ...args); + } + eventNames() { + let finalNamesArray = []; + this._listeners.storage.map((val, key) => { + if (!finalNamesArray.includes(key)) + finalNamesArray.push(key); + }); + this._singularListeners.storage.map((val, key) => { + if (!finalNamesArray.includes(key)) + finalNamesArray.push(key); + }); + return finalNamesArray; + } + listenerCount(eventName) { + const recurring = this._listeners.countListeners(eventName); + const singular = this._singularListeners.countListeners(eventName); + return (recurring + singular); + } + listeners(eventName) { + let recurring = this._listeners.fetchListeners(eventName); + let singular = this._singularListeners.fetchListeners(eventName); + return { + recurring, + singular + }; + } + on(eventName, listener) { + this._listeners.add(eventName, listener); + return; + } + once(eventName, listener) { + this._singularListeners.add(eventName, listener); + return; + } + prependListener(eventName, listener) { + this._listeners.prepend(eventName, listener); + return; + } + prependOnceListener(eventName, listener) { + this._singularListeners.prepend(eventName, listener); + return; + } + removeAllListeners(...eventName) { + const listeners = [...eventName]; + listeners.map(en => { + this._listeners.removeEvent(en); + this._singularListeners.removeEvent(en); + }); + return this; + } + removeListener(eventName, listener) { + this._listeners.removeListener(eventName, listener); + this._singularListeners.removeListener(eventName, listener); + return this; + } +} +exports.Eventra = Eventra; + + +/***/ }), + +/***/ 400: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const Collection_1 = __importDefault(__webpack_require__(580)); +class ListenerArray { + constructor(options) { + this._internalStorage = new Collection_1.default(); + if (!options) + this._options = { mode: "recurring" }; + else + this._options = options; + } + get mode() { return this._options.mode; } + get storage() { return this._internalStorage; } + _updateInternalStorage(collection) { + if (!collection) + return; + this._internalStorage = collection; + return; + } + _cloneInternalStorage() { + const internal = this._internalStorage.clone(); + return internal; + } + add(eventName, listener) { + let carbonCopy = this._cloneInternalStorage(); + let event = carbonCopy.get(eventName); + if (!event) { + carbonCopy.set(eventName, [listener]); + this._updateInternalStorage(carbonCopy); + return this; + } + event.push(listener); + this._updateInternalStorage(carbonCopy); + return this; + } + prepend(eventName, listener) { + let carbonCopy = this._cloneInternalStorage(); + let event = carbonCopy.get(eventName); + if (!event) { + carbonCopy.set(eventName, [listener]); + this._updateInternalStorage(carbonCopy); + return this; + } + event.unshift(listener); + this._updateInternalStorage(carbonCopy); + return this; + } + removeListener(eventName, listener) { + let carbonCopy = this._cloneInternalStorage(); + let event = carbonCopy.get(eventName); + if (!event) + return this; + if (!event.includes(listener)) + return this; + if (event.length == 1) { + carbonCopy.delete(eventName); + this._updateInternalStorage(carbonCopy); + return this; + } + ; + const index = event.indexOf(listener); + if (index > -1) + event.splice(index, 1); + this._updateInternalStorage(carbonCopy); + return this; + } + removeEvent(eventName) { + let carbonCopy = this._cloneInternalStorage(); + let event = carbonCopy.get(eventName); + if (!event) + return this; + carbonCopy.delete(eventName); + this._updateInternalStorage(carbonCopy); + return this; + } + countListeners(eventName) { + const event = this._internalStorage.get(eventName); + if (!event) + return 0; + return event.length; + } + fetchListeners(eventName) { + const event = this._internalStorage.get(eventName); + if (!event) + return []; + return event; + } + executeEvent(eventName, ...args) { + let carbonCopy = this._cloneInternalStorage(); + let event = carbonCopy.get(eventName); + if (!event) + return this; + event.map((method, index) => { + method(...args); + return; + }); + if (this.mode == 'once') + carbonCopy.delete(eventName); + this._updateInternalStorage(carbonCopy); + return this; + } +} +exports.default = ListenerArray; + + +/***/ }), + +/***/ 580: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Collection = void 0; +/** + * A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has + * an ID, for significantly improved performance and ease-of-use. + * @extends {Map} + * @property {number} size - The amount of elements in this collection. + */ +class Collection extends Map { + /** + * Identical to [Map.get()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get). + * Gets an element with the specified key, and returns its value, or `undefined` if the element does not exist. + * @param {*} key - The key to get from this collection + * @returns {* | undefined} + */ + get(key) { + return super.get(key); + } + /** + * Identical to [Map.set()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set). + * Sets a new element in the collection with the specified key and value. + * @param {*} key - The key of the element to add + * @param {*} value - The value of the element to add + * @returns {Collection} + */ + set(key, value) { + return super.set(key, value); + } + /** + * Identical to [Map.has()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has). + * Checks if an element exists in the collection. + * @param {*} key - The key of the element to check for + * @returns {boolean} `true` if the element exists, `false` if it does not exist. + */ + has(key) { + return super.has(key); + } + /** + * Identical to [Map.delete()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete). + * Deletes an element from the collection. + * @param {*} key - The key to delete from the collection + * @returns {boolean} `true` if the element was removed, `false` if the element does not exist. + */ + delete(key) { + return super.delete(key); + } + /** + * Identical to [Map.clear()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear). + * Removes all elements from the collection. + * @returns {undefined} + */ + clear() { + return super.clear(); + } + /** + * Checks if all of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if all of the elements exist, `false` if at least one does not exist. + */ + hasAll(...keys) { + return keys.every((k) => super.has(k)); + } + /** + * Checks if any of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if any of the elements exist, `false` if none exist. + */ + hasAny(...keys) { + return keys.some((k) => super.has(k)); + } + first(amount) { + if (typeof amount === 'undefined') + return this.values().next().value; + if (amount < 0) + return this.last(amount * -1); + amount = Math.min(this.size, amount); + const iter = this.values(); + return Array.from({ length: amount }, () => iter.next().value); + } + firstKey(amount) { + if (typeof amount === 'undefined') + return this.keys().next().value; + if (amount < 0) + return this.lastKey(amount * -1); + amount = Math.min(this.size, amount); + const iter = this.keys(); + return Array.from({ length: amount }, () => iter.next().value); + } + last(amount) { + const arr = [...this.values()]; + if (typeof amount === 'undefined') + return arr[arr.length - 1]; + if (amount < 0) + return this.first(amount * -1); + if (!amount) + return []; + return arr.slice(-amount); + } + lastKey(amount) { + const arr = [...this.keys()]; + if (typeof amount === 'undefined') + return arr[arr.length - 1]; + if (amount < 0) + return this.firstKey(amount * -1); + if (!amount) + return []; + return arr.slice(-amount); + } + random(amount) { + const arr = [...this.values()]; + if (typeof amount === 'undefined') + return arr[Math.floor(Math.random() * arr.length)]; + if (!arr.length || !amount) + return []; + return Array.from({ length: Math.min(amount, arr.length) }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); + } + randomKey(amount) { + const arr = [...this.keys()]; + if (typeof amount === 'undefined') + return arr[Math.floor(Math.random() * arr.length)]; + if (!arr.length || !amount) + return []; + return Array.from({ length: Math.min(amount, arr.length) }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); + } + find(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (fn(val, key, this)) + return val; + } + return undefined; + } + findKey(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (fn(val, key, this)) + return key; + } + return undefined; + } + sweep(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const previousSize = this.size; + for (const [key, val] of this) { + if (fn(val, key, this)) + this.delete(key); + } + return previousSize - this.size; + } + filter(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const results = new this.constructor[Symbol.species](); + for (const [key, val] of this) { + if (fn(val, key, this)) + results.set(key, val); + } + return results; + } + partition(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const results = [ + new this.constructor[Symbol.species](), + new this.constructor[Symbol.species](), + ]; + for (const [key, val] of this) { + if (fn(val, key, this)) { + results[0].set(key, val); + } + else { + results[1].set(key, val); + } + } + return results; + } + flatMap(fn, thisArg) { + const collections = this.map(fn, thisArg); + return new this.constructor[Symbol.species]().concat(...collections); + } + map(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const iter = this.entries(); + return Array.from({ length: this.size }, () => { + const [key, value] = iter.next().value; + return fn(value, key, this); + }); + } + mapValues(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + const coll = new this.constructor[Symbol.species](); + for (const [key, val] of this) + coll.set(key, fn(val, key, this)); + return coll; + } + some(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (fn(val, key, this)) + return true; + } + return false; + } + every(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + for (const [key, val] of this) { + if (!fn(val, key, this)) + return false; + } + return true; + } + /** + * Applies a function to produce a single value. Identical in behavior to + * [Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce). + * @param {Function} fn Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`, + * and `collection` + * @param {*} [initialValue] Starting value for the accumulator + * @returns {*} + * @example collection.reduce((acc, guild) => acc + guild.memberCount, 0); + */ + reduce(fn, initialValue) { + let accumulator; + if (typeof initialValue !== 'undefined') { + accumulator = initialValue; + for (const [key, val] of this) + accumulator = fn(accumulator, val, key, this); + return accumulator; + } + let first = true; + for (const [key, val] of this) { + if (first) { + accumulator = val; + first = false; + continue; + } + accumulator = fn(accumulator, val, key, this); + } + // No items iterated. + if (first) { + throw new TypeError('Reduce of empty collection with no initial value'); + } + return accumulator; + } + each(fn, thisArg) { + this.forEach(fn, thisArg); + return this; + } + tap(fn, thisArg) { + if (typeof thisArg !== 'undefined') + fn = fn.bind(thisArg); + fn(this); + return this; + } + /** + * Creates an identical shallow copy of this collection. + * @returns {Collection} + * @example const newColl = someColl.clone(); + */ + clone() { + return new this.constructor[Symbol.species](this); + } + /** + * Combines this collection with others into a new collection. None of the source collections are modified. + * @param {...Collection} collections Collections to merge + * @returns {Collection} + * @example const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl); + */ + concat(...collections) { + const newColl = this.clone(); + for (const coll of collections) { + for (const [key, val] of coll) + newColl.set(key, val); + } + return newColl; + } + /** + * Checks if this collection shares identical items with another. + * This is different to checking for equality using equal-signs, because + * the collections may be different objects, but contain the same data. + * @param {Collection} collection Collection to compare with + * @returns {boolean} Whether the collections have identical contents + */ + equals(collection) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!collection) + return false; // runtime check + if (this === collection) + return true; + if (this.size !== collection.size) + return false; + for (const [key, value] of this) { + if (!collection.has(key) || value !== collection.get(key)) { + return false; + } + } + return true; + } + /** + * The sort method sorts the items of a collection in place and returns it. + * The sort is not necessarily stable in Node 10 or older. + * The default sort order is according to string Unicode code points. + * @param {Function} [compareFunction] Specifies a function that defines the sort order. + * If omitted, the collection is sorted according to each character's Unicode code point value, + * according to the string conversion of each element. + * @returns {Collection} + * @example collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); + */ + sort(compareFunction = Collection.defaultSort) { + const entries = [...this.entries()]; + entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0])); + // Perform clean-up + super.clear(); + // Set the new entries + for (const [k, v] of entries) { + super.set(k, v); + } + return this; + } + /** + * The intersect method returns a new structure containing items where the keys are present in both original structures. + * @param {Collection} other The other Collection to filter against + * @returns {Collection} + */ + intersect(other) { + const coll = new this.constructor[Symbol.species](); + for (const [k, v] of other) { + if (this.has(k)) + coll.set(k, v); + } + return coll; + } + /** + * The difference method returns a new structure containing items where the key is present in one of the original structures but not the other. + * @param {Collection} other The other Collection to filter against + * @returns {Collection} + */ + difference(other) { + const coll = new this.constructor[Symbol.species](); + for (const [k, v] of other) { + if (!this.has(k)) + coll.set(k, v); + } + for (const [k, v] of this) { + if (!other.has(k)) + coll.set(k, v); + } + return coll; + } + /** + * The sorted method sorts the items of a collection and returns it. + * The sort is not necessarily stable in Node 10 or older. + * The default sort order is according to string Unicode code points. + * @param {Function} [compareFunction] Specifies a function that defines the sort order. + * If omitted, the collection is sorted according to each character's Unicode code point value, + * according to the string conversion of each element. + * @returns {Collection} + * @example collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); + */ + sorted(compareFunction = Collection.defaultSort) { + return new this.constructor[Symbol.species](this).sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk)); + } + static defaultSort(firstValue, secondValue) { + return Number(firstValue > secondValue) || Number(firstValue === secondValue) - 1; + } +} +exports.Collection = Collection; +Collection.default = Collection; +exports.default = Collection; + + +/***/ }), + +/***/ 284: +/***/ ((module) => { + +var naiveFallback = function () { + if (typeof self === "object" && self) return self; + if (typeof window === "object" && window) return window; + throw new Error("Unable to resolve global `this`"); +}; + +module.exports = (function () { + if (this) return this; + + // Unexpected strict mode (may happen if e.g. bundled into ESM module) + + // Fallback to standard globalThis if available + if (typeof globalThis === "object" && globalThis) return globalThis; + + // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis + // In all ES5+ engines global object inherits from Object.prototype + // (if you approached one that doesn't please report) + try { + Object.defineProperty(Object.prototype, "__global__", { + get: function () { return this; }, + configurable: true + }); + } catch (error) { + // Unfortunate case of updates to Object.prototype being restricted + // via preventExtensions, seal or freeze + return naiveFallback(); + } + try { + // Safari case (window.__global__ works, but __global__ does not) + if (!__global__) return naiveFallback(); + return __global__; + } finally { + delete Object.prototype.__global__; + } +})(); + + +/***/ }), + +/***/ 614: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "NIL": () => (/* reexport */ nil), + "parse": () => (/* reexport */ esm_browser_parse), + "stringify": () => (/* reexport */ esm_browser_stringify), + "v1": () => (/* reexport */ esm_browser_v1), + "v3": () => (/* reexport */ esm_browser_v3), + "v4": () => (/* reexport */ esm_browser_v4), + "v5": () => (/* reexport */ esm_browser_v5), + "validate": () => (/* reexport */ esm_browser_validate), + "version": () => (/* reexport */ esm_browser_version) +}); + +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +var getRandomValues; +var rnds8 = new Uint8Array(16); +function rng() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, + // find the complete implementation of crypto (msCrypto) on IE11. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js +/* harmony default export */ const regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js + + +function validate(uuid) { + return typeof uuid === 'string' && regex.test(uuid); +} + +/* harmony default export */ const esm_browser_validate = (validate); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +var byteToHex = []; + +for (var i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!esm_browser_validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +/* harmony default export */ const esm_browser_stringify = (stringify); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v1.js + + // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +var _nodeId; + +var _clockseq; // Previous uuid creation time + + +var _lastMSecs = 0; +var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || new Array(16); + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + var seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || esm_browser_stringify(b); +} + +/* harmony default export */ const esm_browser_v1 = (v1); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/parse.js + + +function parse(uuid) { + if (!esm_browser_validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + var v; + var arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +/* harmony default export */ const esm_browser_parse = (parse); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v35.js + + + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + var bytes = []; + + for (var i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +/* harmony default export */ function v35(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = esm_browser_parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + var bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return esm_browser_stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/md5.js +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (var i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + var output = []; + var length32 = input.length * 32; + var hexTab = '0123456789abcdef'; + + for (var i = 0; i < length32; i += 8) { + var x = input[i >> 5] >>> i % 32 & 0xff; + var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for (var i = 0; i < x.length; i += 16) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + var length8 = input.length * 8; + var output = new Uint32Array(getOutputLength(length8)); + + for (var i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +/* harmony default export */ const esm_browser_md5 = (md5); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v3.js + + +var v3 = v35('v3', 0x30, esm_browser_md5); +/* harmony default export */ const esm_browser_v3 = (v3); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + + + +function v4(options, buf, offset) { + options = options || {}; + var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return esm_browser_stringify(rnds); +} + +/* harmony default export */ const esm_browser_v4 = (v4); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/sha1.js +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (var i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + var l = bytes.length / 4 + 2; + var N = Math.ceil(l / 16); + var M = new Array(N); + + for (var _i = 0; _i < N; ++_i) { + var arr = new Uint32Array(16); + + for (var j = 0; j < 16; ++j) { + arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; + } + + M[_i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (var _i2 = 0; _i2 < N; ++_i2) { + var W = new Uint32Array(80); + + for (var t = 0; t < 16; ++t) { + W[t] = M[_i2][t]; + } + + for (var _t = 16; _t < 80; ++_t) { + W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); + } + + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + for (var _t2 = 0; _t2 < 80; ++_t2) { + var s = Math.floor(_t2 / 20); + var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +/* harmony default export */ const esm_browser_sha1 = (sha1); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v5.js + + +var v5 = v35('v5', 0x50, esm_browser_sha1); +/* harmony default export */ const esm_browser_v5 = (v5); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/nil.js +/* harmony default export */ const nil = ('00000000-0000-0000-0000-000000000000'); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/version.js + + +function version(uuid) { + if (!esm_browser_validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +/* harmony default export */ const esm_browser_version = (version); +;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/index.js + + + + + + + + + + +/***/ }), + +/***/ 840: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _globalThis; +if (typeof globalThis === 'object') { + _globalThis = globalThis; +} else { + try { + _globalThis = __webpack_require__(284); + } catch (error) { + } finally { + if (!_globalThis && typeof window !== 'undefined') { _globalThis = window; } + if (!_globalThis) { throw new Error('Could not determine global this'); } + } +} + +var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket; +var websocket_version = __webpack_require__(387); + + +/** + * Expose a W3C WebSocket class with just one or two arguments. + */ +function W3CWebSocket(uri, protocols) { + var native_instance; + + if (protocols) { + native_instance = new NativeWebSocket(uri, protocols); + } + else { + native_instance = new NativeWebSocket(uri); + } + + /** + * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket + * class). Since it is an Object it will be returned as it is when creating an + * instance of W3CWebSocket via 'new W3CWebSocket()'. + * + * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2 + */ + return native_instance; +} +if (NativeWebSocket) { + ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) { + Object.defineProperty(W3CWebSocket, prop, { + get: function() { return NativeWebSocket[prop]; } + }); + }); +} + +/** + * Module exports. + */ +module.exports = { + 'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null, + 'version' : websocket_version +}; + + +/***/ }), + +/***/ 387: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = __webpack_require__(847).version; + + +/***/ }), + +/***/ 847: +/***/ ((module) => { + +"use strict"; +module.exports = {"version":"1.0.34"}; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(659); +/******/ trixi = __webpack_exports__; +/******/ +/******/ })() +; \ No newline at end of file diff --git a/dist/trixi.min.js b/dist/trixi.min.js new file mode 100644 index 0000000..944766d --- /dev/null +++ b/dist/trixi.min.js @@ -0,0 +1 @@ +var trixi;(()=>{var t={659:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return s(e,t),e},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createClient=void 0;var a=r(825),u=o(r(614)),c=i(r(436)),l=r(840);e.createClient=function(t){var e,r=!1,n=t.url,s=t.origin,o=null!==(e=t.headers)&&void 0!==e?e:{},i=new a.Eventra,h=new l.w3cwebsocket(n,"echo-protocol",s);function f(){for(var t=[],e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collection=void 0;class r extends Map{get(t){return super.get(t)}set(t,e){return super.set(t,e)}has(t){return super.has(t)}delete(t){return super.delete(t)}clear(){return super.clear()}hasAll(...t){return t.every((t=>super.has(t)))}hasAny(...t){return t.some((t=>super.has(t)))}first(t){if(void 0===t)return this.values().next().value;if(t<0)return this.last(-1*t);t=Math.min(this.size,t);const e=this.values();return Array.from({length:t},(()=>e.next().value))}firstKey(t){if(void 0===t)return this.keys().next().value;if(t<0)return this.lastKey(-1*t);t=Math.min(this.size,t);const e=this.keys();return Array.from({length:t},(()=>e.next().value))}last(t){const e=[...this.values()];return void 0===t?e[e.length-1]:t<0?this.first(-1*t):t?e.slice(-t):[]}lastKey(t){const e=[...this.keys()];return void 0===t?e[e.length-1]:t<0?this.firstKey(-1*t):t?e.slice(-t):[]}random(t){const e=[...this.values()];return void 0===t?e[Math.floor(Math.random()*e.length)]:e.length&&t?Array.from({length:Math.min(t,e.length)},(()=>e.splice(Math.floor(Math.random()*e.length),1)[0])):[]}randomKey(t){const e=[...this.keys()];return void 0===t?e[Math.floor(Math.random()*e.length)]:e.length&&t?Array.from({length:Math.min(t,e.length)},(()=>e.splice(Math.floor(Math.random()*e.length),1)[0])):[]}find(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return r}findKey(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return e}sweep(t,e){void 0!==e&&(t=t.bind(e));const r=this.size;for(const[e,r]of this)t(r,e,this)&&this.delete(e);return r-this.size}filter(t,e){void 0!==e&&(t=t.bind(e));const r=new this.constructor[Symbol.species];for(const[e,n]of this)t(n,e,this)&&r.set(e,n);return r}partition(t,e){void 0!==e&&(t=t.bind(e));const r=[new this.constructor[Symbol.species],new this.constructor[Symbol.species]];for(const[e,n]of this)t(n,e,this)?r[0].set(e,n):r[1].set(e,n);return r}flatMap(t,e){const r=this.map(t,e);return(new this.constructor[Symbol.species]).concat(...r)}map(t,e){void 0!==e&&(t=t.bind(e));const r=this.entries();return Array.from({length:this.size},(()=>{const[e,n]=r.next().value;return t(n,e,this)}))}mapValues(t,e){void 0!==e&&(t=t.bind(e));const r=new this.constructor[Symbol.species];for(const[e,n]of this)r.set(e,t(n,e,this));return r}some(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return!0;return!1}every(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(!t(r,e,this))return!1;return!0}reduce(t,e){let r;if(void 0!==e){r=e;for(const[e,n]of this)r=t(r,n,e,this);return r}let n=!0;for(const[e,s]of this)n?(r=s,n=!1):r=t(r,s,e,this);if(n)throw new TypeError("Reduce of empty collection with no initial value");return r}each(t,e){return this.forEach(t,e),this}tap(t,e){return void 0!==e&&(t=t.bind(e)),t(this),this}clone(){return new this.constructor[Symbol.species](this)}concat(...t){const e=this.clone();for(const r of t)for(const[t,n]of r)e.set(t,n);return e}equals(t){if(!t)return!1;if(this===t)return!0;if(this.size!==t.size)return!1;for(const[e,r]of this)if(!t.has(e)||r!==t.get(e))return!1;return!0}sort(t=r.defaultSort){const e=[...this.entries()];e.sort(((e,r)=>t(e[1],r[1],e[0],r[0]))),super.clear();for(const[t,r]of e)super.set(t,r);return this}intersect(t){const e=new this.constructor[Symbol.species];for(const[r,n]of t)this.has(r)&&e.set(r,n);return e}difference(t){const e=new this.constructor[Symbol.species];for(const[r,n]of t)this.has(r)||e.set(r,n);for(const[r,n]of this)t.has(r)||e.set(r,n);return e}sorted(t=r.defaultSort){return new this.constructor[Symbol.species](this).sort(((e,r,n,s)=>t(e,r,n,s)))}static defaultSort(t,e){return Number(t>e)||Number(t===e)-1}}e.Collection=r,r.default=r,e.default=r},825:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Eventra=void 0;const s=n(r(400));e.Eventra=class{constructor(){this._listeners=new s.default({mode:"recurring"}),this._singularListeners=new s.default({mode:"once"}),this.addListener=this.on,this.off=this.removeListener}emit(t,...e){this._listeners.executeEvent(t,...e),this._singularListeners.executeEvent(t,...e)}eventNames(){let t=[];return this._listeners.storage.map(((e,r)=>{t.includes(r)||t.push(r)})),this._singularListeners.storage.map(((e,r)=>{t.includes(r)||t.push(r)})),t}listenerCount(t){return this._listeners.countListeners(t)+this._singularListeners.countListeners(t)}listeners(t){return{recurring:this._listeners.fetchListeners(t),singular:this._singularListeners.fetchListeners(t)}}on(t,e){this._listeners.add(t,e)}once(t,e){this._singularListeners.add(t,e)}prependListener(t,e){this._listeners.prepend(t,e)}prependOnceListener(t,e){this._singularListeners.prepend(t,e)}removeAllListeners(...t){return[...t].map((t=>{this._listeners.removeEvent(t),this._singularListeners.removeEvent(t)})),this}removeListener(t,e){return this._listeners.removeListener(t,e),this._singularListeners.removeListener(t,e),this}}},400:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const s=n(r(580));e.default=class{constructor(t){this._internalStorage=new s.default,this._options=t||{mode:"recurring"}}get mode(){return this._options.mode}get storage(){return this._internalStorage}_updateInternalStorage(t){t&&(this._internalStorage=t)}_cloneInternalStorage(){return this._internalStorage.clone()}add(t,e){let r=this._cloneInternalStorage(),n=r.get(t);return n?(n.push(e),this._updateInternalStorage(r),this):(r.set(t,[e]),this._updateInternalStorage(r),this)}prepend(t,e){let r=this._cloneInternalStorage(),n=r.get(t);return n?(n.unshift(e),this._updateInternalStorage(r),this):(r.set(t,[e]),this._updateInternalStorage(r),this)}removeListener(t,e){let r=this._cloneInternalStorage(),n=r.get(t);if(!n)return this;if(!n.includes(e))return this;if(1==n.length)return r.delete(t),this._updateInternalStorage(r),this;const s=n.indexOf(e);return s>-1&&n.splice(s,1),this._updateInternalStorage(r),this}removeEvent(t){let e=this._cloneInternalStorage();return e.get(t)?(e.delete(t),this._updateInternalStorage(e),this):this}countListeners(t){const e=this._internalStorage.get(t);return e?e.length:0}fetchListeners(t){return this._internalStorage.get(t)||[]}executeEvent(t,...e){let r=this._cloneInternalStorage(),n=r.get(t);return n?(n.map(((t,r)=>{t(...e)})),"once"==this.mode&&r.delete(t),this._updateInternalStorage(r),this):this}}},580:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collection=void 0;class r extends Map{get(t){return super.get(t)}set(t,e){return super.set(t,e)}has(t){return super.has(t)}delete(t){return super.delete(t)}clear(){return super.clear()}hasAll(...t){return t.every((t=>super.has(t)))}hasAny(...t){return t.some((t=>super.has(t)))}first(t){if(void 0===t)return this.values().next().value;if(t<0)return this.last(-1*t);t=Math.min(this.size,t);const e=this.values();return Array.from({length:t},(()=>e.next().value))}firstKey(t){if(void 0===t)return this.keys().next().value;if(t<0)return this.lastKey(-1*t);t=Math.min(this.size,t);const e=this.keys();return Array.from({length:t},(()=>e.next().value))}last(t){const e=[...this.values()];return void 0===t?e[e.length-1]:t<0?this.first(-1*t):t?e.slice(-t):[]}lastKey(t){const e=[...this.keys()];return void 0===t?e[e.length-1]:t<0?this.firstKey(-1*t):t?e.slice(-t):[]}random(t){const e=[...this.values()];return void 0===t?e[Math.floor(Math.random()*e.length)]:e.length&&t?Array.from({length:Math.min(t,e.length)},(()=>e.splice(Math.floor(Math.random()*e.length),1)[0])):[]}randomKey(t){const e=[...this.keys()];return void 0===t?e[Math.floor(Math.random()*e.length)]:e.length&&t?Array.from({length:Math.min(t,e.length)},(()=>e.splice(Math.floor(Math.random()*e.length),1)[0])):[]}find(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return r}findKey(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return e}sweep(t,e){void 0!==e&&(t=t.bind(e));const r=this.size;for(const[e,r]of this)t(r,e,this)&&this.delete(e);return r-this.size}filter(t,e){void 0!==e&&(t=t.bind(e));const r=new this.constructor[Symbol.species];for(const[e,n]of this)t(n,e,this)&&r.set(e,n);return r}partition(t,e){void 0!==e&&(t=t.bind(e));const r=[new this.constructor[Symbol.species],new this.constructor[Symbol.species]];for(const[e,n]of this)t(n,e,this)?r[0].set(e,n):r[1].set(e,n);return r}flatMap(t,e){const r=this.map(t,e);return(new this.constructor[Symbol.species]).concat(...r)}map(t,e){void 0!==e&&(t=t.bind(e));const r=this.entries();return Array.from({length:this.size},(()=>{const[e,n]=r.next().value;return t(n,e,this)}))}mapValues(t,e){void 0!==e&&(t=t.bind(e));const r=new this.constructor[Symbol.species];for(const[e,n]of this)r.set(e,t(n,e,this));return r}some(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(t(r,e,this))return!0;return!1}every(t,e){void 0!==e&&(t=t.bind(e));for(const[e,r]of this)if(!t(r,e,this))return!1;return!0}reduce(t,e){let r;if(void 0!==e){r=e;for(const[e,n]of this)r=t(r,n,e,this);return r}let n=!0;for(const[e,s]of this)n?(r=s,n=!1):r=t(r,s,e,this);if(n)throw new TypeError("Reduce of empty collection with no initial value");return r}each(t,e){return this.forEach(t,e),this}tap(t,e){return void 0!==e&&(t=t.bind(e)),t(this),this}clone(){return new this.constructor[Symbol.species](this)}concat(...t){const e=this.clone();for(const r of t)for(const[t,n]of r)e.set(t,n);return e}equals(t){if(!t)return!1;if(this===t)return!0;if(this.size!==t.size)return!1;for(const[e,r]of this)if(!t.has(e)||r!==t.get(e))return!1;return!0}sort(t=r.defaultSort){const e=[...this.entries()];e.sort(((e,r)=>t(e[1],r[1],e[0],r[0]))),super.clear();for(const[t,r]of e)super.set(t,r);return this}intersect(t){const e=new this.constructor[Symbol.species];for(const[r,n]of t)this.has(r)&&e.set(r,n);return e}difference(t){const e=new this.constructor[Symbol.species];for(const[r,n]of t)this.has(r)||e.set(r,n);for(const[r,n]of this)t.has(r)||e.set(r,n);return e}sorted(t=r.defaultSort){return new this.constructor[Symbol.species](this).sort(((e,r,n,s)=>t(e,r,n,s)))}static defaultSort(t,e){return Number(t>e)||Number(t===e)-1}}e.Collection=r,r.default=r,e.default=r},284:t=>{var e=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}()},614:(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{NIL:()=>j,parse:()=>g,stringify:()=>l,v1:()=>v,v3:()=>I,v4:()=>A,v5:()=>x,validate:()=>a,version:()=>C});var s=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(s)}const i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,a=function(t){return"string"==typeof t&&i.test(t)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var h,f,d=0,p=0;const v=function(t,e,r){var n=e&&r||0,s=e||new Array(16),i=(t=t||{}).node||h,a=void 0!==t.clockseq?t.clockseq:f;if(null==i||null==a){var u=t.random||(t.rng||o)();null==i&&(i=h=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=f=16383&(u[6]<<8|u[7]))}var c=void 0!==t.msecs?t.msecs:Date.now(),v=void 0!==t.nsecs?t.nsecs:p+1,g=c-d+(v-p)/1e4;if(g<0&&void 0===t.clockseq&&(a=a+1&16383),(g<0||c>d)&&void 0===t.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=c,p=v,f=a;var y=(1e4*(268435455&(c+=122192928e5))+v)%4294967296;s[n++]=y>>>24&255,s[n++]=y>>>16&255,s[n++]=y>>>8&255,s[n++]=255&y;var m=c/4294967296*1e4&268435455;s[n++]=m>>>8&255,s[n++]=255&m,s[n++]=m>>>24&15|16,s[n++]=m>>>16&255,s[n++]=a>>>8|128,s[n++]=255&a;for(var b=0;b<6;++b)s[n+b]=i[b];return e||l(s)},g=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function y(t,e,r){function n(t,n,s,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r>>9<<4)+1}function b(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function _(t,e,r,n,s,o){return b((i=b(b(e,t),b(n,o)))<<(a=s)|i>>>32-a,r);var i,a}function w(t,e,r,n,s,o,i){return _(e&r|~e&n,t,e,s,o,i)}function S(t,e,r,n,s,o,i){return _(e&n|r&~n,t,e,s,o,i)}function M(t,e,r,n,s,o,i){return _(e^r^n,t,e,s,o,i)}function L(t,e,r,n,s,o,i){return _(r^(e|~n),t,e,s,o,i)}const I=y("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r>5]>>>s%32&255,i=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[n/8])<>>32-e}const x=y("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var s=0;s>>0;b=m,m=y,y=E(g,30)>>>0,g=v,v=S}r[0]=r[0]+v>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),j="00000000-0000-0000-0000-000000000000",C=function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}},840:(t,e,r)=>{var n;if("object"==typeof globalThis)n=globalThis;else try{n=r(284)}catch(t){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var s=n.WebSocket||n.MozWebSocket,o=r(387);function i(t,e){return e?new s(t,e):new s(t)}s&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(t){Object.defineProperty(i,t,{get:function(){return s[t]}})})),t.exports={w3cwebsocket:s?i:null,version:o}},387:(t,e,r)=>{t.exports=r(847).version},847:t=>{"use strict";t.exports={version:"1.0.34"}}},e={};function r(n){var s=e[n];if(void 0!==s)return s.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n=r(659);trixi=n})(); \ No newline at end of file diff --git a/package.json b/package.json index d2efbd2..039d7bd 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,40 @@ { - "name": "trixi", - "author": "Jackson Roberts ", - "version": "1.1.3", - "main": "lib/index.js", - "repository": "https://github.com/duxcore/trixi.git", - "private": false, - "license": "GPL-3.0", - "scripts": { - "build": "tsc", - "postinstall": "tsc" - }, - "dependencies": { - "@discordjs/collection": "^0.1.6", - "@types/node": "^15.12.2", - "tiny-typed-emitter": "^2.0.3", - "typescript": "^4.2.4", - "uuid": "^8.3.2", - "websocket": "^1.0.34" - }, - "devDependencies": { - "@types/uuid": "^8.3.0", - "@types/websocket": "^1.0.2" - }, - "keywords": [ - "websocket", - "websockets", - "trixi", - "duxcore", - "operators" - ] + "name": "trixi", + "author": "Jackson Roberts ", + "version": "1.1.3", + "main": "lib/index.js", + "repository": "https://github.com/duxcore/trixi.git", + "private": false, + "license": "GPL-3.0-or-later", + "scripts": { + "build": "zx scripts/build.mjs -wp" + }, + "dependencies": { + "@discordjs/collection": "^0.2.0", + "@duxcore/eventra": "^1.0.1", + "@types/websocket": "^1.0.3", + "eventra": "^1.1.2", + "json-buffer": "^3.0.1", + "ps-std": "^0.1.0-1", + "tiny-typed-emitter": "^2.0.3", + "uncased": "^1.0.0-5", + "uuid": "^8.3.2", + "websocket": "^1.0.34" + }, + "devDependencies": { + "@types/json-buffer": "^3.0.0", + "@types/node": "^14", + "@types/uuid": "^8.3.1", + "typescript": "^4.3.5", + "webpack": "^5.46.0", + "webpack-cli": "^4.7.2", + "zx": "^2.0.0" + }, + "keywords": [ + "websocket", + "websockets", + "trixi", + "duxcore", + "operators" + ] } diff --git a/scripts/build.mjs b/scripts/build.mjs new file mode 100644 index 0000000..b934857 --- /dev/null +++ b/scripts/build.mjs @@ -0,0 +1,25 @@ +#!/usr/bin/env zx + +console.log("Building...") + +await $`yarn install --silent` + +const options = process.argv.slice(3); +let parameters = { + webpack: false, + typescript: true, + mode: "production" +} + +options.map((opt, index) => { + if (['--webpack', '-wp'].includes(opt)) parameters.webpack = true; + if (['--dev', '-d'].includes(opt)) parameters.mode = 'development' +}); + +if (parameters.typescript) await $`tsc`; +if (parameters.webpack) { + await $`webpack -o dist --config webpack/nm-webpack.config.js --no-stats` + await $`webpack -o dist --config webpack/webpack.config.js --no-stats` +} + +console.log('Done!'); \ No newline at end of file diff --git a/src/handlers/handleHttpRequest.ts b/src/handlers/handleHttpRequest.ts new file mode 100644 index 0000000..96b889c --- /dev/null +++ b/src/handlers/handleHttpRequest.ts @@ -0,0 +1,147 @@ +import JSONB from 'json-buffer'; +import { IncomingMessage, ServerResponse } from 'http'; +import { Routes } from '../lib/createServer'; +import parseURL from '../lib/parseURL'; +import { InteractionMethod, InteractionStack } from '../types/interaction'; + +// import this from somewhere or something idk +function rejectInvalidRoute( + method: string, + route: string[], + res: ServerResponse +) { + res.statusCode = 400; + res.write(`Cannot ${method.toUpperCase()} /${route.join('/')}`); + res.end(); +} + +export default function handleHttpRequest(routes: Routes) { + return function handleRequest( + req: IncomingMessage, + res: ServerResponse, + body: Buffer + ) { + let uri = req.url || '/'; + let method = (req.method || 'GET').toUpperCase(); + + const header_pairs: [string, string][] = []; + + for (let i = 0; i < req.rawHeaders.length; i += 2) { + header_pairs.push([`${req.rawHeaders[i]}`, `${req.rawHeaders[i + 1]}`]); + } + + let headers_ar: { + [name: string]: string[]; + } = {}; + + for (const [name, val] of header_pairs) { + if (name && val !== undefined) { + if (headers_ar[name]) { + headers_ar[name].push(val); + } else { + headers_ar[name] = [val]; + } + } + } + + const headers: { + [name: string]: string | string[]; + } = {}; + + for (const [name, val] of Object.entries(headers_ar)) { + if (val.length > 1) { + headers[name] = val; + } else { + headers[name] = val[0]; + } + } + + const { parts, query } = parseURL(uri); + + let params: { + [key: string]: string; + } = {}; + + let r: | Routes | InteractionStack | { + [method: string]: InteractionStack; + } = routes; + + for (const part of parts) { + const lcp = part.toLowerCase(); + if (r[lcp]) { + r = r[lcp]; + } else if (r['*']) { + r = r['*']; + params[`${(r as any).__param_name}` || ''] = part; + } else { + return rejectInvalidRoute(method, parts, res); + } + } + + // Handle both any verb, and specific verb + if (!(r instanceof Array)) { + r = r[method]; + } + + if (r instanceof Array) { + (async () => { + const cookies = (() => { + const cks = headers['Cookie']; + if (!cks) return {} + + const splitA = cks.toString().split(";").map(val => val.trim()); + let response = {} + splitA.map(val => { + const split = val.split('='); + response[split[0]] = split[1]; + }); + + return response; + })(); + + const request = { + uri, + method, + cookies, + headers, + query, + params, + }; + const response = { + respond: (status: number, data: object) => { + res.statusCode = status; + if (data instanceof Buffer) { + res.write(data); + } else { + res.setHeader('Content-Type', 'application/json'); + res.write(JSONB.stringify(data)); + } + res.end(); + }, + setHeader: (header: string, value: string) => { + res.setHeader(header, value); + return; + }, + }; + // execute stuff; r is an InteractionStack + // headers => { [ string ] : string | string[] } + // query => { [ string ] : string | string[] } + // params => [ ...string ] + + const rr = [...r]; + const executor = rr.pop() as InteractionMethod; + const middleware = rr; + + let proms: Promise[] = middleware.map( + (fn) => new Promise((res) => fn(request, response, res)) + ); + + if (proms.length > 0) await Promise.all(proms); + + executor(request, response); + })(); + } else { + return rejectInvalidRoute(method, parts, res); + } + }; +} \ No newline at end of file diff --git a/src/handlers/handleWebSocketMessage.ts b/src/handlers/handleWebSocketMessage.ts new file mode 100644 index 0000000..600bd16 --- /dev/null +++ b/src/handlers/handleWebSocketMessage.ts @@ -0,0 +1,126 @@ +import { connection } from 'websocket'; +import { IMessage } from 'websocket'; +import { Routes } from '../lib/createServer'; +import parseURL from '../lib/parseURL'; +import sendWsObject from '../lib/sendWSObject'; +import { InteractionMethod, InteractionStack } from '../types/interaction'; +import * as uuid from 'uuid'; +import { RawSocketObject } from '../types/socket'; + +function rejectInvalidRoute(method: string, route: string[], msg: RawSocketObject, connection: connection) { + return sendError(`Cannot ${method.toUpperCase()} /${route.join('/')}`, "INVALID_ROUTE", method, route, msg, connection); +} + +function sendError( message: string, code: string, method: string, route: string[], msg: RawSocketObject, connection: connection) { + const reference = msg.reference; + const responseObject = { + error: { + message, + code + } + } + + sendWsObject(connection, { + headers: {}, + status: 400, + method: msg.method, + operator: `ERROR_${msg.uri}`, + reference: reference ?? uuid.v4(), + uri: msg.uri, + data: responseObject + }) +} + +export function handleWebSocketMessage(connection: connection, msg: IMessage, routes: Routes) { + const req: RawSocketObject = JSON.parse(msg.utf8Data?.toString() as string); + + let uri = req.uri || '/'; + let method = (req.method || 'GET').toUpperCase(); + + const headers: { + [name: string]: string | string[]; + } = req.headers ?? {}; + + const { parts, query } = parseURL(uri); + + let params: { + [key: string]: string; + } = {}; + + let r: | Routes | InteractionStack | { + [method: string]: InteractionStack; + } = routes; + + for (const part of parts) { + const lcp = part.toLowerCase(); + if (r[lcp]) { + r = r[lcp]; + } else if (r['*']) { + r = r['*']; + params[`${(r as any).__param_name}` || ''] = part; + } else { + return rejectInvalidRoute(method, parts, req, connection); + } + } + + if (r instanceof Array) { + (async () => { + const cookies = (() => { + const cks = headers['Cookie']; + if (!cks) return {} + + const splitA = cks.toString().split(";").map(val => val.trim()); + let response = {} + splitA.map(val => { + const split = val.split('='); + response[split[0]] = split[1]; + }); + + return response; + })(); + + const request = { + uri, + method, + cookies, + headers, + query, + params, + }; + + let responseHeaders = {}; + + const response = { + respond: (status: number, data: object) => { + const responseObject: RawSocketObject = { + uri, + status, + operator: `REPLY_${uri}`, + headers: responseHeaders, + method: req.method, + reference: req.reference ?? uuid.v4(), + data: data + } + }, + setHeader: (header: string, value: string) => { + responseHeaders[header] = value; + return; + }, + }; + + const rr = [...r]; + const executor = rr.pop() as InteractionMethod; + const middleware = rr; + + let proms: Promise[] = middleware.map( + (fn) => new Promise((res) => fn(request, response, res)) + ); + + if (proms.length > 0) await Promise.all(proms); + + executor(request, response); + })(); + } else { + return rejectInvalidRoute(method, parts, req, connection); + } +} diff --git a/src/helpers/createPayload.ts b/src/helpers/createPayload.ts deleted file mode 100644 index d3e3636..0000000 --- a/src/helpers/createPayload.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PayloadObject } from "../types/Payload"; -import * as uuid from 'uuid'; - -export default function createPayload(op, payload?, ref?): PayloadObject { - return { - op: op, - p: payload ?? null, - ref: ref ?? uuid.v4() - }; -} \ No newline at end of file diff --git a/src/helpers/createRawPayload.ts b/src/helpers/createRawPayload.ts deleted file mode 100644 index 0ddccf2..0000000 --- a/src/helpers/createRawPayload.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CreateRawPayloadOpts, PayloadObject, RawPayloadObject } from "../types/Payload"; - -export default function createRawPayload(payload: PayloadObject, { - type -}: CreateRawPayloadOpts): RawPayloadObject { - return { - payload, - meta: { - type, - timestamp: new Date().getTime() - } - }; -} \ No newline at end of file diff --git a/src/helpers/payloadManagers.ts b/src/helpers/payloadManagers.ts deleted file mode 100644 index 6a1d743..0000000 --- a/src/helpers/payloadManagers.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { connection } from "websocket"; -import { SocketConnectionObject } from "../types/Connection"; -import { AssertedPayloadManager, MessagePayloadManager, OperatorPayloadManager, PayloadObject, PayloadType, RawPayloadObject } from "../types/Payload"; -import createRawPayload from "./createRawPayload"; - -export function messagePayloadManager(connection: connection, { - payload, - meta: { - timestamp, - type - } -}: RawPayloadObject): MessagePayloadManager { - - return { - data: payload.p, - op: payload.op, - parsed: payload, - reference: payload.ref, - timestamp, - type, - reply(data) { - const payloadBase = createRawPayload({ - op: this.op, - p: data, - ref: this.reference - }, { type: PayloadType.MessageResponse }); - - - - connection.send(JSON.stringify(payloadBase)); - }, - onResponse(callback) { - connection.on("message", (data) => { - const jsonData: RawPayloadObject = JSON.parse(data.utf8Data ?? ""); - if (jsonData.payload.ref == this.reference && jsonData.meta.type == PayloadType.MessageResponse) callback(messagePayloadManager(connection, jsonData)); - }) - } - } -} - -export function assertedPayloadManager(connection: connection, { - payload, - meta: { - timestamp, - type - } -}: RawPayloadObject): AssertedPayloadManager { - - return { - data: payload.p, - op: payload.op, - parsed: payload, - reference: payload.ref, - timestamp, - type - } -} - -export function operatorPayloadManager(connection: connection, { - payload, - meta: { - timestamp, - type - } -}: RawPayloadObject): OperatorPayloadManager { - - return { - data: payload.p, - op: payload.op, - parsed: payload, - reference: payload.ref, - timestamp, - type, - reply(data) { - const payloadBase = createRawPayload({ - op: this.op, - p: data, - ref: this.reference - }, { type: PayloadType.OperatorResponse }); - - connection.send(JSON.stringify(payloadBase)); - }, - onResponse(callback) { - connection.on("message", (data) => { - const jsonData: RawPayloadObject = JSON.parse(data.utf8Data ?? ""); - if (jsonData.payload.ref == this.reference && jsonData.meta.type == PayloadType.OperatorResponse) callback(messagePayloadManager(connection, jsonData)); - }) - } - } -} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 92c53e6..0000000 --- a/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import trixi from "./trixi"; - -export default trixi; - -export * from './types/Connection'; -export * from './types/Payload'; - -export * from './types/Trixi'; -export * from './types/TrixiClient'; -export * from './types/TrixiServer'; \ No newline at end of file diff --git a/src/lib/createClient.ts b/src/lib/createClient.ts new file mode 100644 index 0000000..3a1bee5 --- /dev/null +++ b/src/lib/createClient.ts @@ -0,0 +1,117 @@ +import { Eventra } from '@duxcore/eventra' +import { ClientOptions } from '../types/client'; +import { RawSocketObject } from '../types/socket'; +import { HeaderType } from '../types/general'; +import * as uuid from 'uuid'; +import Collection from '@discordjs/collection'; +import { w3cwebsocket } from 'websocket'; + +export function createClient(options: ClientOptions) { + let isOpen = false; + + const url = options.url; + const origin = options.origin; + const headers = options.headers ?? {}; + + const wse = new Eventra() + const ws = new w3cwebsocket(url, 'echo-protocol', origin); + + ws.onopen = function open() { + isOpen = true; + wse.emit('open'); + return; + } + + ws.onclose = function close() { + isOpen = false; + wse.emit('close'); + return; + } + + ws.onerror = function error(error) { + throw error; + } + + ws.onmessage = function incomming(event) { + const interaction: RawSocketObject = JSON.parse(event.data.toString()); + wse.emit('interaction', interaction); + } + + function assebleHeaders(...headers: HeaderType[]): HeaderType { + let finalHeaders: HeaderType = {} + + headers.forEach(header => { + finalHeaders = Object.assign(finalHeaders, header); + }); + + return finalHeaders; + } + + let _responseListeners = new Collection void>() + + wse.on('interaction', (interaction) => { + _responseListeners.map((callback, reference) => { + if (reference === interaction.reference) { + _responseListeners.delete(reference); + if (interaction.operator?.startsWith('ERROR')) { + const error = new Error(`(${interaction.data.error.code}): ${interaction.data.error.message}`); + return callback(interaction, error); + } + return callback(interaction, null); + } + }) + }) + + function awaitResponse(reference, callback: (data: RawSocketObject, error: any) => void) { + _responseListeners.set(reference, callback); + } + + return { + ws, + + on: wse.on, + once: wse.once, + addListener: wse.addListener, + listeners: wse.listeners, + prependListener: wse.prependListener, + prependOnceListener: wse.prependOnceListener, + + send(dispatch: DispatchConfiguration, callback: (response: RawSocketObject | null, error: any) => void) { + const data = dispatch.data; + const uri = dispatch.uri; + const method = dispatch.method; + const reference = dispatch.reference ?? uuid.v4(); + + const payloadData: RawSocketObject = { + uri, + data, + headers: assebleHeaders(headers, (dispatch.headers ?? {})), + method, + reference + } + + const dataString = JSON.stringify(payloadData); + + if (!isOpen) wse.on('open', () => ws.send(dataString)); + else ws.send(dataString) + + awaitResponse(reference, callback); + } + } +} + +export interface DispatchConfiguration { + uri: string; + data?: any | object; + method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE" + reference?: string; + headers?: { + [name: string]: string; + } +} + +export interface WebSocketEvents { + 'open': () => void; + 'close': () => void; + 'interaction': (interaction: RawSocketObject) => void; +} \ No newline at end of file diff --git a/src/lib/createHttpServer.ts b/src/lib/createHttpServer.ts new file mode 100644 index 0000000..7c5bd99 --- /dev/null +++ b/src/lib/createHttpServer.ts @@ -0,0 +1,47 @@ +import http from 'http'; +import { server as WebSocketServer } from 'websocket'; +import { CreateServerOptions } from './createServer'; + +export type ListenerObject = (req, res, chunks) => void; + +export default function createHttpServer( + options: CreateServerOptions, + listener: ListenerObject +) { + const ports = options.port instanceof Array ? options.port : [options.port]; + + const server = http.createServer((req, res) => { + const body_chunks = Array(); + req.on('data', (chunk: Buffer) => body_chunks.push(chunk)); + req.on('end', () => { + listener(req, res, Buffer.concat(body_chunks)); + }); + }); + + const ws = new WebSocketServer({ + httpServer: server, + autoAcceptConnections: false, + }); + + let listen_success = false; + let listen_failed = false; + let thrown_error: Error | undefined; + for (const port of ports) { + try { + listen_success = true; + server.listen(+port); + } catch (error) { + listen_failed = true; + thrown_error = thrown_error; + } + } + + if (!listen_success || (!options.ignorePortBindingError && listen_failed)) { + throw thrown_error || new Error('No port specified.'); + } + + return { + server, + ws, + }; +} diff --git a/src/lib/createServer.ts b/src/lib/createServer.ts new file mode 100644 index 0000000..4dc8802 --- /dev/null +++ b/src/lib/createServer.ts @@ -0,0 +1,84 @@ +import handleHttpRequest from '../handlers/handleHttpRequest'; +import { handleWebSocketMessage } from '../handlers/handleWebSocketMessage'; +import { InteractionStack } from '../types/interaction'; +import createHttpServer from './createHttpServer'; +import {TypedEmitter} from 'tiny-typed-emitter'; +import TrixiEvents from '../types/events'; + +export type Method = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'ALL'; + +// much types +export type Routes = { + [part: string]: Routes | { + [method: string]: InteractionStack; + } +} + +export let events = new TypedEmitter() + +function setRoute (routes: Routes, method: string, route: string, methods: InteractionStack) { + let r: object = routes; + for (let part of route.split(/[\\\/]+/g).filter(a=>a)) { + if ((part[0] === ':') || (part === '*')) { + if (!r['*']) r['*'] = {}; + (r = r['*']).__param_name = part.substr(1); + } else { + if (!r[part]) { + r[part] = {}; + } + r = r[part]; + } + } + r[method] = methods; +} + +export default function createServer(options: CreateServerOptions, started?: () => void) { + const routes: Routes = {}; + + const { server, ws } = createHttpServer(options, handleHttpRequest(routes)); + started && process.nextTick(started); + + const isOriginAllowed = (origin: string) => { + return true; + }; + + ws.on('request', (request) => { + if (!isOriginAllowed(request.origin)) + return request.reject(401, 'Request denied'); + + const connection = request.accept('echo-protocol', request.origin); + connection.on('message', (msg) => { + const interaction = handleWebSocketMessage(connection, msg, routes); + }); + }); + + return Object.assign(events, { + port: options.port, + get(route: string, ...methods: InteractionStack) { + setRoute(routes, 'GET', route, methods); + }, + post(route: string, ...methods: InteractionStack) { + setRoute(routes, 'POST', route, methods); + }, + put(route: string, ...methods: InteractionStack) { + setRoute(routes, 'PUT', route, methods); + }, + delete(route: string, ...methods: InteractionStack) { + setRoute(routes, 'DELETE', route, methods); + }, + patch(route: string, ...methods: InteractionStack) { + setRoute(routes, 'PATCH', route, methods); + }, + all(route: string, ...methods: InteractionStack) { + setRoute(routes, '*', route, methods); + }, + set (method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | '*', route: string, methods: InteractionStack) { + return setRoute(routes, method.toUpperCase(), route, methods); + }, + }) +} + +export interface CreateServerOptions { + port: number | number[]; + ignorePortBindingError?: boolean; +} \ No newline at end of file diff --git a/src/lib/parseURL.ts b/src/lib/parseURL.ts new file mode 100644 index 0000000..739d7b2 --- /dev/null +++ b/src/lib/parseURL.ts @@ -0,0 +1,21 @@ +export default function parseURL(url: string): { + parts: string[]; + query: { + [key: string]: string[]; + }; +} { + const pqs = url.replace(/[^a-z0-9\$\–\_\.\+\!\*\(\)\,\?\&\=\/\%]/gi, ''); + const [ps, qs] = [...pqs.split(/\?/), '']; + const parts = ps.split(/[\\\/]/gi).filter((a) => a); + const query: { + [k: string]: string[]; + } = {}; + if (qs) { + let qparts = qs.split(/[\&]/g); + for (const qp of qparts) { + const [k, v] = [...qp.split('='), '']; + query[k] ? query[k].push(v) : (query[k] = [v]); + } + } + return { parts, query }; +} \ No newline at end of file diff --git a/src/lib/sendWSObject.ts b/src/lib/sendWSObject.ts new file mode 100644 index 0000000..3e83bab --- /dev/null +++ b/src/lib/sendWSObject.ts @@ -0,0 +1,7 @@ +import { connection } from 'websocket'; +import { RawSocketObject } from '../types/socket'; + +export default function sendWsObject(connection: connection, object: RawSocketObject) { + connection.send(JSON.stringify(object)); + return; +} \ No newline at end of file diff --git a/src/lib/socketConnection.ts b/src/lib/socketConnection.ts deleted file mode 100644 index 50eabcd..0000000 --- a/src/lib/socketConnection.ts +++ /dev/null @@ -1,98 +0,0 @@ -import Collection from "@discordjs/collection"; -import { connection } from "websocket"; -import createPayload from "../helpers/createPayload"; -import createRawPayload from "../helpers/createRawPayload"; -import { assertedPayloadManager, messagePayloadManager, operatorPayloadManager } from "../helpers/payloadManagers"; -import { ClientAssertCallback, ClientMessageCallback, ClientOperatorCallback, ConnectionCloseCallback, SocketConnectionObject, SocketConnectionOptions } from "../types/Connection"; -import { PayloadType, RawPayloadObject } from "../types/Payload"; - -export default function socketConnection({ - connection, - origin, - host, - remoteAddress -}: SocketConnectionOptions): SocketConnectionObject { - - let assertionEventCallbacks: ClientAssertCallback[] = []; - let payloadEventCallbacks: ClientMessageCallback[] = []; - let operatorEventCallbacks = new Collection(); - let connectionCloseEventCallbacks: ConnectionCloseCallback[] = []; - - connection.on("message", data => { - const json: RawPayloadObject = JSON.parse(data.utf8Data ?? ""); - - operatorEventCallbacks.map((cb, operator) => { - const manager = operatorPayloadManager(connection, json); - if (manager.op !== operator || manager.type !== PayloadType.Operator) return; - - return cb(manager); - }); - - assertionEventCallbacks.map(cb => { - const manager = assertedPayloadManager(connection, json); - if (json.meta.type !== PayloadType.AssertedMessage) return; - - return cb(manager); - }); - - payloadEventCallbacks.map(cb => { - const json: RawPayloadObject = JSON.parse(data.utf8Data ?? ""); - const manager = messagePayloadManager(connection, json); - - if (json.meta.type !== PayloadType.Message) return; - - return cb(manager); - }) - }); - - connection.on("close", () => { - connectionCloseEventCallbacks.map(e => { - e(); - }) - }) - - return { - host, - origin, - remoteAddress, - - onOp(operator: string, event) { operatorEventCallbacks.set(operator, event); }, - onAssert(event) { assertionEventCallbacks.push(event); }, - onPayload(event) { payloadEventCallbacks.push(event); }, - onClose(event) { connectionCloseEventCallbacks.push(event) }, - - sendOp(operator: string, args: any) { - return new Promise(async (resolve, reject) => { - const payload = createRawPayload(createPayload(operator, args), { type: PayloadType.Operator }); - const payloadString = JSON.stringify(payload, null, 2); - - connection.send(payloadString, err => { - if (err) return reject(err); - return resolve(operatorPayloadManager(connection, payload)); - }); - }) - }, - send(args: any) { - return new Promise((resolve, reject) => { - const payload = createRawPayload(createPayload("trixi:message", args), { type: PayloadType.Message }) - const payloadString = JSON.stringify(payload, null, 2); - - connection.send(payloadString, err => { - if (err) return reject(err); - return resolve(messagePayloadManager(connection, payload)); - }); - }) - }, - assert(args: any) { - return new Promise((resolve, reject) => { - const payload = createRawPayload(createPayload("trixi:assertion", args), { type: PayloadType.AssertedMessage }) - const payloadString = JSON.stringify(payload, null, 2); - - connection.send(payloadString, err => { - if (err) return reject(err); - return resolve(assertedPayloadManager(connection, payload)); - }); - }) - } - }; -} \ No newline at end of file diff --git a/src/lib/trixiClient.ts b/src/lib/trixiClient.ts deleted file mode 100644 index 36857dc..0000000 --- a/src/lib/trixiClient.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { connection, w3cwebsocket } from "websocket"; -import createPayload from "../helpers/createPayload"; -import createRawPayload from "../helpers/createRawPayload"; -import { assertedPayloadManager, messagePayloadManager, operatorPayloadManager } from "../helpers/payloadManagers"; -import { ClientAssertCallback, ClientOperatorCallback, ClientMessageCallback } from "../types/Connection"; -import { PayloadType, RawPayloadObject } from "../types/Payload"; -import { TrixiClient, TrixiClientOptions } from "../types/TrixiClient"; -import Collection from '@discordjs/collection'; - -export default function trixiClient({ - url -}: TrixiClientOptions): TrixiClient { - const ws = new w3cwebsocket(url, 'echo-protocol', "trixi:client"); - - let connected: boolean = false; - - const wscon = ((r: (connection: connection) => void)=> { - const interval = setInterval(() => { - if (connected) return r(ws._connection as connection); - if (!ws._connection) return; - connected = true; - - r(ws._connection); - return clearInterval(interval) - }, 10) - }) - - let assertionEventCallbacks: ClientAssertCallback[] = []; - let payloadEventCallbacks: ClientMessageCallback[] = []; - let operatorEventCallbacks = new Collection(); - - const getConnection = ((cb: (connection: connection) => void) => { wscon(connection => cb(connection)) }); - - ws.onopen = async () => { - const connection = (await ws._connection) as connection - ws.onmessage = e => { - const json: RawPayloadObject = JSON.parse(e.data.toString()); - - operatorEventCallbacks.map((cb, operator) => { - const manager = operatorPayloadManager(connection, json); - if (manager.op !== operator || manager.type !== PayloadType.Operator) return; - - return cb(manager); - }); - - assertionEventCallbacks.map(cb => { - const manager = assertedPayloadManager(connection, json); - if (json.meta.type !== PayloadType.AssertedMessage) return; - - return cb(manager); - }); - - payloadEventCallbacks.map(cb => { - const json: RawPayloadObject = JSON.parse(e.data.toString()); - const manager = messagePayloadManager(connection, json); - - if (json.meta.type !== PayloadType.Message) return; - - return cb(manager); - }) - } - } - - return { - url, - onOp(operator: string, event) { operatorEventCallbacks.set(operator, event); }, - onAssert(event) { assertionEventCallbacks.push(event); }, - onPayload(event) { payloadEventCallbacks.push(event); }, - - sendOp(operator: string, args: any) { - return new Promise((resolve, reject) => { - getConnection(connection => { - const payload = createRawPayload(createPayload(operator, args), { type: PayloadType.Operator }); - const payloadString = JSON.stringify(payload, null, 2); - - ws.send(payloadString); - return resolve(operatorPayloadManager(connection, payload)); - }); - }) - }, - send(args: any) { - return new Promise((resolve, reject) => { - getConnection(connection => { - const payload = createRawPayload(createPayload("trixi:message", args), { type: PayloadType.Message }); - const payloadString = JSON.stringify(payload, null, 2); - - connection.send(payloadString, err => { - if (err) return reject(err); - return resolve(messagePayloadManager(connection, payload)); - }); - }); - }); - }, - assert(args: any) { - return new Promise((resolve, reject) => { - getConnection(connection => { - const payload = createRawPayload(createPayload("trixi:assertion", args), { type: PayloadType.AssertedMessage }); - const payloadString = JSON.stringify(payload, null, 2); - - connection.send(payloadString, err => { - if (err) return reject(err); - return resolve(assertedPayloadManager(connection, payload)); - }); - }); - }) - }, - - close() { - return new Promise((resolve, _rej) => { - getConnection(connection => { - connection.close(); - return resolve(); - }); - }); - } - }; -} \ No newline at end of file diff --git a/src/lib/trixiServer.ts b/src/lib/trixiServer.ts deleted file mode 100644 index 9305de2..0000000 --- a/src/lib/trixiServer.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ConnectionListener, RequestValidator, TrixiServer, TrixiServerEvents, TrixiServerOptions } from "../types/TrixiServer"; -import { connection, request, server as WebSocketServer} from 'websocket'; -import { TypedEmitter } from 'tiny-typed-emitter'; -import socketConnection from "./socketConnection"; - -export default function trixiServer({ - httpServer -}: TrixiServerOptions): TrixiServer { - const ws = new WebSocketServer({ - httpServer - }); - - let requestValidator: RequestValidator = req => true; - let connectionListeners: ConnectionListener[] = []; - - const newConnection = (connection: connection, request: request) => { - connectionListeners.map(cL => { - setTimeout(() => { - const sco = socketConnection({ - connection, - host: request.host, - origin: request.origin, - remoteAddress: request.remoteAddress - }); - - cL(sco); - }, 2) - }); - } - - ws.on("request", request => { - if (!requestValidator(request)) return request.reject(); - const connection = request.accept("echo-protocol", request.origin); - newConnection(connection, request); - }); - - return { - httpServer, - onConnection(event) { - connectionListeners.push(event); - } - } -} \ No newline at end of file diff --git a/src/trixi.ts b/src/trixi.ts index 938b7ab..44c300a 100644 --- a/src/trixi.ts +++ b/src/trixi.ts @@ -1,10 +1,3 @@ -import trixiClient from "./lib/trixiClient"; -import trixiServer from "./lib/trixiServer"; -import { Trixi } from "./types/Trixi"; +import createServer from './lib/createServer'; -export default function trixi(): Trixi { - return { - createServer: trixiServer, - createClient: trixiClient - }; -} \ No newline at end of file +export { createServer }; diff --git a/src/types/Connection.ts b/src/types/Connection.ts deleted file mode 100644 index f9b9b87..0000000 --- a/src/types/Connection.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { connection } from "websocket"; -import { AssertedPayloadManager, OperatorPayloadManager, MessagePayloadManager } from "./Payload"; - -export type ClientOperatorCallback = (event: OperatorPayloadManager) => void; -export type ClientMessageCallback = (event: MessagePayloadManager) => void; -export type ClientAssertCallback = (event: AssertedPayloadManager) => void; -export type ConnectionCloseCallback = () => {} - -export interface SocketConnectionOptions { - connection: connection; // Raw Socket Connection Object - origin: string; // origin of the socket connection - host: string; // The host of the socket connection - remoteAddress: string; // The remote address of the socket connection -} - -export interface SocketConnectionObject { - host: string; - remoteAddress: string; - origin: string; - - onOp(op: string, event: ClientOperatorCallback): void; - sendOp(op: string, payload: any): Promise; - - send(payload: any): Promise; - assert(payload: any): Promise; - - onPayload(event: ClientMessageCallback): void; - onAssert(event: ClientAssertCallback): void; - - onClose(event: ConnectionCloseCallback): void -} \ No newline at end of file diff --git a/src/types/Payload.ts b/src/types/Payload.ts deleted file mode 100644 index ebb76ef..0000000 --- a/src/types/Payload.ts +++ /dev/null @@ -1,48 +0,0 @@ -export interface RawPayloadObject { - payload: PayloadObject, - meta: RawPayloadMeta -} - -export enum PayloadType { - Message = "type:message", - Operator = "type:Operator", - MessageResponse = "type:message_response", - AssertedMessage = "type:asserted_message", - OperatorResponse = "type:operator_response", -} - -interface PayloadManagerBase { - readonly op: string, - readonly data: any, - readonly parsed: PayloadObject, - readonly reference: string, - readonly type: PayloadType, - readonly timestamp: number -} - -export interface MessagePayloadManager extends PayloadManagerBase { - reply(data: any): void; - onResponse(callback: (payload: MessagePayloadManager) => void): void; -} - -export interface AssertedPayloadManager extends PayloadManagerBase {} - -export interface OperatorPayloadManager extends PayloadManagerBase { - reply(data: any): void; - onResponse(callback: (payload: OperatorPayloadManager) => void): void; -} - -export interface RawPayloadMeta { - type: PayloadType; - timestamp: number; -} - -export interface CreateRawPayloadOpts { - type: PayloadType; -} - -export interface PayloadObject { - op: string; // Operator Code - p: any | null; // Payload Data - ref: string; // Reference ID -} \ No newline at end of file diff --git a/src/types/Trixi.ts b/src/types/Trixi.ts deleted file mode 100644 index 5feaf7b..0000000 --- a/src/types/Trixi.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { TrixiClient, TrixiClientOptions } from "./TrixiClient"; -import { TrixiServer, TrixiServerOptions } from "./TrixiServer"; - -export interface Trixi { - createServer: (options: TrixiServerOptions) => TrixiServer; - createClient: (options: TrixiClientOptions) => TrixiClient; -} \ No newline at end of file diff --git a/src/types/TrixiClient.ts b/src/types/TrixiClient.ts deleted file mode 100644 index a36b259..0000000 --- a/src/types/TrixiClient.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ClientAssertCallback, ClientOperatorCallback, ClientMessageCallback } from "./Connection"; -import { AssertedPayloadManager, MessagePayloadManager, OperatorPayloadManager } from "./Payload"; - -export interface TrixiClient { - readonly url: string; - onOp(op: string, event: ClientOperatorCallback): void; - sendOp(op: string, payload: any): Promise; - - send(payload: any): Promise; - assert(payload: any): Promise; - - onPayload(event: ClientMessageCallback): void; - onAssert(event: ClientAssertCallback): void; - - close(): Promise; -} - -export interface TrixiClientOptions { - url: string; -} diff --git a/src/types/TrixiServer.ts b/src/types/TrixiServer.ts deleted file mode 100644 index 84d3716..0000000 --- a/src/types/TrixiServer.ts +++ /dev/null @@ -1,19 +0,0 @@ -import http from 'http'; -import { request } from 'websocket'; -import { SocketConnectionObject } from './Connection'; - -export type RequestValidator = (request: request) => boolean; -export type ConnectionListener = (connection: SocketConnectionObject) => void; - -export interface TrixiServer { - httpServer: http.Server; - onConnection(connection: ConnectionListener): void, -} - -export interface TrixiServerEvents { - "connection": (connection: SocketConnectionObject) => void; -} - -export interface TrixiServerOptions { - httpServer: http.Server; -} \ No newline at end of file diff --git a/src/types/client.ts b/src/types/client.ts new file mode 100644 index 0000000..e328c9f --- /dev/null +++ b/src/types/client.ts @@ -0,0 +1,7 @@ +import { HeaderType } from "./general"; + +export interface ClientOptions { + url: string, + origin: string, + headers?: HeaderType +} \ No newline at end of file diff --git a/src/types/events.ts b/src/types/events.ts new file mode 100644 index 0000000..dd74b74 --- /dev/null +++ b/src/types/events.ts @@ -0,0 +1,3 @@ +export default interface TrixiEvents { + "ready": () => void +} \ No newline at end of file diff --git a/src/types/general.ts b/src/types/general.ts new file mode 100644 index 0000000..9243661 --- /dev/null +++ b/src/types/general.ts @@ -0,0 +1,3 @@ +export interface HeaderType { + [name: string]: string +} \ No newline at end of file diff --git a/src/types/interaction.ts b/src/types/interaction.ts new file mode 100644 index 0000000..4a353c1 --- /dev/null +++ b/src/types/interaction.ts @@ -0,0 +1,25 @@ +export type InteractionMethod = (req: InteractionRequest, res: InteractionResponse) => void; +export type InteractionMiddlewareMethod = (req: InteractionRequest, res: InteractionResponse, next: () => void) => void; + +export type InteractionStack = [...InteractionMiddlewareMethod[] & InteractionMethod]; + +export interface InteractionRequest { + uri: string; + method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | string; + cookies: { + [name: string]: string | string[]; + } + headers: { + [name: string]: string | string[]; + } + query: { + [name: string]: string[]; + } + params: { + [name: string]: string | string[]; + } +} +export interface InteractionResponse { + respond(status: number, data: object); + setHeader(header: string, value: string); +} \ No newline at end of file diff --git a/src/types/socket.ts b/src/types/socket.ts new file mode 100644 index 0000000..0ce89e9 --- /dev/null +++ b/src/types/socket.ts @@ -0,0 +1,11 @@ +export interface RawSocketObject { + uri: string; + status?: number; + method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; + data?: any | null; + headers: { + [name: string]: string; + }; + operator?: string; + reference: string; +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 253688b..7cf66fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,21 +1,21 @@ - { - "compilerOptions": { - "outDir": "./lib", - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "declaration": true, - "noImplicitAny": false - }, - "include": ["src/**/*.ts"] -} \ No newline at end of file + "compilerOptions": { + "outDir": "./lib", + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "declaration": true, + "noImplicitAny": false + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/"] +} diff --git a/webpack/nm-webpack.config.js b/webpack/nm-webpack.config.js new file mode 100644 index 0000000..59b1461 --- /dev/null +++ b/webpack/nm-webpack.config.js @@ -0,0 +1,16 @@ +const path = require('path'); +const webpack = require('webpack') + +module.exports = { + entry: './lib/lib/createClient.js', + + output: { + path: 'dist', + filename: 'trixi.js', + libraryTarget: "var", + library: 'trixi', + }, + optimization: { + minimize: false + }, +}; \ No newline at end of file diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js new file mode 100644 index 0000000..1c05dac --- /dev/null +++ b/webpack/webpack.config.js @@ -0,0 +1,13 @@ +const path = require('path'); +const webpack = require('webpack') + +module.exports = { + entry: './lib/lib/createClient.js', + + output: { + path: 'dist', + filename: 'trixi.min.js', + libraryTarget: "var", + library: 'trixi', + }, +}; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d6364a4..014f17f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,28 +2,290 @@ # yarn lockfile v1 -"@discordjs/collection@^0.1.6": - version "0.1.6" - resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-0.1.6.tgz#9e9a7637f4e4e0688fd8b2b5c63133c91607682c" - integrity sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ== - -"@types/node@*", "@types/node@^15.12.2": - version "15.12.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d" - integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww== - -"@types/uuid@^8.3.0": - version "8.3.0" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.0.tgz#215c231dff736d5ba92410e6d602050cce7e273f" - integrity sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== - -"@types/websocket@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.2.tgz#d2855c6a312b7da73ed16ba6781815bf30c6187a" - integrity sha512-B5m9aq7cbbD/5/jThEr33nUY8WEfVi6A2YKCTOvw5Ldy7mtsOkqRvGjnzy6g7iMMDsgu7xREuCzqATLDLQVKcQ== +"@discordjs/collection@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-0.2.0.tgz#ddf93c24956a70d4bc97bdd40027e6f0f2d5dafe" + integrity sha512-ZSiyfQsQmJq5EDgTocUg6n7IOft64MH/53RC8q3+Z5Ltipgc6eH1lLyDMJz2fcY/xq5zrILd9LyqFgEdragDNA== + +"@discoveryjs/json-ext@^0.5.0": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz#90420f9f9c6d3987f176a19a7d8e764271a2f55d" + integrity sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g== + +"@duxcore/eventra@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@duxcore/eventra/-/eventra-1.0.1.tgz#e76bd65c88980a885c08cab5a11c60ae662ee0e6" + integrity sha512-5QdBihJjGRTmtnZQS+Fa1Dy92gwhxz4anoaPdRxsyB910MOmGQPqdF1LaXJz53htMD4tPVvT6kZUi58WxfV4Gg== + +"@types/eslint-scope@^3.7.0": + version "3.7.1" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e" + integrity sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.28.0.tgz#7e41f2481d301c68e14f483fe10b017753ce8d5a" + integrity sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^0.0.50": + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + +"@types/fs-extra@^9.0.11": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.12.tgz#9b8f27973df8a7a3920e8461517ebf8a7d4fdfaf" + integrity sha512-I+bsBr67CurCGnSenZZ7v94gd3tc3+Aj2taxMT4yu4ABLuOgOjeFxX3dokG24ztSRg5tnT00sL8BszO7gSMoIw== dependencies: "@types/node" "*" +"@types/json-buffer@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/json-buffer/-/json-buffer-3.0.0.tgz#85c1ff0f0948fc159810d4b5be35bf8c20875f64" + integrity sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ== + +"@types/json-schema@*", "@types/json-schema@^7.0.8": + version "7.0.8" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818" + integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg== + +"@types/minimist@^1.2.1": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" + integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== + +"@types/node-fetch@^2.5.10": + version "2.5.11" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.11.tgz#ce22a2e65fc8999f4dbdb7ddbbcf187d755169e4" + integrity sha512-2upCKaqVZETDRb8A2VTaRymqFBEgH8u6yr96b/u3+1uQEPDRo3mJLEiPk7vdXBHRtjwkjqzFYMJXrt0Z9QsYjQ== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + +"@types/node@*", "@types/node@^16.0": + version "16.4.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.0.tgz#2c219eaa3b8d1e4d04f4dd6e40bc68c7467d5272" + integrity sha512-HrJuE7Mlqcjj+00JqMWpZ3tY8w7EUd+S0U3L1+PQSWiXZbOgyQDvi+ogoUxaHApPJq5diKxYBQwA3iIlNcPqOg== + +"@types/node@^14": + version "14.17.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.5.tgz#b59daf6a7ffa461b5648456ca59050ba8e40ed54" + integrity sha512-bjqH2cX/O33jXT/UmReo2pM7DIJREPMnarixbQ57DOOzzFaI6D2+IcwaJQaJpv0M1E9TIhPCYVxrkcityLjlqA== + +"@types/uuid@^8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" + integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== + +"@types/websocket@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.3.tgz#49e09f939afd0ccdee4f7108d4712ec9feb0f153" + integrity sha512-ZdoTSwmDsKR7l1I8fpfQtmTI/hUwlOvE3q0iyJsp4tXU0MkdrYowimDzwxjhQvxU4qjhHLd3a6ig0OXRbLgIdw== + dependencies: + "@types/node" "*" + +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== + +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== + +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== + +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== + +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== + +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webpack-cli/configtest@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.4.tgz#f03ce6311c0883a83d04569e2c03c6238316d2aa" + integrity sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ== + +"@webpack-cli/info@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.3.0.tgz#9d78a31101a960997a4acd41ffd9b9300627fe2b" + integrity sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w== + dependencies: + envinfo "^7.7.3" + +"@webpack-cli/serve@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.5.1.tgz#b5fde2f0f79c1e120307c415a4c1d5eb15a6f278" + integrity sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw== + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +acorn@^8.4.1: + version "8.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" + integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== + +ajv-keywords@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== + +ajv@^6.12.5: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + 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" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +browserslist@^4.14.5: + version "4.16.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" + integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== + dependencies: + caniuse-lite "^1.0.30001219" + colorette "^1.2.2" + electron-to-chromium "^1.3.723" + escalade "^3.1.1" + node-releases "^1.1.71" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + bufferutil@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.3.tgz#66724b756bed23cd7c28c4d306d7994f9943cc6b" @@ -31,6 +293,76 @@ bufferutil@^4.0.1: dependencies: node-gyp-build "^4.2.0" +caniuse-lite@^1.0.30001219: + version "1.0.30001246" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001246.tgz#fe17d9919f87124d6bb416ef7b325356d69dc76c" + integrity sha512-Tc+ff0Co/nFNbLOrziBXmMVtpt9S2c2Y+Z9Nk9Khj09J+0zR9ejvIW5qkZAErCbOrVODCx/MN+GpB5FNBs5GFA== + +chalk@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chrome-trace-event@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^1.2.1, colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -46,6 +378,34 @@ debug@^2.2.0: dependencies: ms "2.0.0" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +electron-to-chromium@^1.3.723: + version "1.3.784" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.784.tgz#c370be79374b02b7f13e8a8fb0d7a02641161dac" + integrity sha512-JTPxdUibkefeomWNaYs8lI/x/Zb4cOhZWX+d7kpzsNKzUd07pNuo/AcHeNJ/qgEchxM1IAxda9aaGUhKN/poOg== + +enhanced-resolve@^5.8.0: + version "5.8.2" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" + integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +envinfo@^7.7.3: + version "7.8.1" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" + integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + +es-module-lexer@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.7.1.tgz#c2c8e0f46f2df06274cdaf0dd3f3b33e0a0b267d" + integrity sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw== + es5-ext@^0.10.35, es5-ext@^0.10.50: version "0.10.53" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" @@ -72,6 +432,61 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + +eventra@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/eventra/-/eventra-1.1.2.tgz#c859e64ff6bbf18731feb605de8075c0adaa44e8" + integrity sha512-yvC25vvHeHsZjSBWRYzn2LsbnxEgRDPGmBESh47EUhSoise4LC7oPGwk6z+DnIRNZkDaJwniaqfoBGhq+FvHbg== + +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + 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" + ext@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" @@ -79,26 +494,457 @@ ext@^1.1.2: dependencies: type "^2.0.0" +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fastest-levenshtein@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" + integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== + +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +fs-extra@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: + version "4.2.6" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +import-local@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" + integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +interpret@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" + integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== + +is-core-module@^2.2.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491" + integrity sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg== + dependencies: + has "^1.0.3" + +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +jest-worker@^27.0.2: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" + integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +json-buffer@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +loader-runner@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" + integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +mime-db@1.48.0: + version "1.48.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" + integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== + +mime-types@^2.1.12, mime-types@^2.1.27: + version "2.1.31" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" + integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== + dependencies: + mime-db "1.48.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + node-gyp-build@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== +node-releases@^1.1.71: + version "1.1.73" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20" + integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +ps-std@^0.1.0-1: + version "0.1.0-1" + resolved "https://registry.yarnpkg.com/ps-std/-/ps-std-0.1.0-1.tgz#05a0ff9563b2ec90fae8e6e727fbf670f2989107" + integrity sha512-JVgkMucgZqZZU9PBPojgV2WW9kUGv+cJAirNdH2o3+cTGLljLSvBapuP2u1d/KPoKApOFNZ0hpVR5IcpJiPxTw== + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +rechoir@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686" + integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== + dependencies: + resolve "^1.9.0" + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve@^1.9.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +schema-utils@^3.0.0, schema-utils@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +source-list-map@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== + +source-map-support@~0.5.19: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@~0.7.2: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" + integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw== + +terser-webpack-plugin@^5.1.3: + version "5.1.4" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz#c369cf8a47aa9922bd0d8a94fe3d3da11a7678a1" + integrity sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA== + dependencies: + jest-worker "^27.0.2" + p-limit "^3.1.0" + schema-utils "^3.0.0" + serialize-javascript "^6.0.0" + source-map "^0.6.1" + terser "^5.7.0" + +terser@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784" + integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg== + dependencies: + commander "^2.20.0" + source-map "~0.7.2" + source-map-support "~0.5.19" + tiny-typed-emitter@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/tiny-typed-emitter/-/tiny-typed-emitter-2.0.3.tgz#4335e3a75127ae7faba91b02e91615d97dc8db7d" @@ -121,10 +967,27 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" - integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== +typescript@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== + +uncased@^1.0.0-5: + version "1.0.0-5" + resolved "https://registry.yarnpkg.com/uncased/-/uncased-1.0.0-5.tgz#2ae867ecbfba3cf0bb205d363932833405a04ea2" + integrity sha512-hHllLJUjwXI6dff8sys62K7j0/Fk/fUJtJlT/Af3a/KI82baFeSowp73cZomGx0ewiB9pi9VnAn4rOFQhfEIZQ== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" utf-8-validate@^5.0.2: version "5.0.5" @@ -138,6 +1001,83 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +watchpack@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.2.0.tgz#47d78f5415fe550ecd740f99fe2882323a58b1ce" + integrity sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + +webpack-cli@^4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.7.2.tgz#a718db600de6d3906a4357e059ae584a89f4c1a5" + integrity sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^1.0.4" + "@webpack-cli/info" "^1.3.0" + "@webpack-cli/serve" "^1.5.1" + colorette "^1.2.1" + commander "^7.0.0" + execa "^5.0.0" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^2.2.0" + rechoir "^0.7.0" + v8-compile-cache "^2.2.0" + webpack-merge "^5.7.3" + +webpack-merge@^5.7.3: + version "5.8.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" + integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== + dependencies: + clone-deep "^4.0.1" + wildcard "^2.0.0" + +webpack-sources@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.3.1.tgz#570de0af163949fe272233c2cefe1b56f74511fd" + integrity sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA== + dependencies: + source-list-map "^2.0.1" + source-map "^0.6.1" + +webpack@^5.46.0: + version "5.46.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.46.0.tgz#105d20d96f79db59b316b0ae54316f0f630314b5" + integrity sha512-qxD0t/KTedJbpcXUmvMxY5PUvXDbF8LsThCzqomeGaDlCA6k998D8yYVwZMvO8sSM3BTEOaD4uzFniwpHaTIJw== + dependencies: + "@types/eslint-scope" "^3.7.0" + "@types/estree" "^0.0.50" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.4.1" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.8.0" + es-module-lexer "^0.7.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.4" + json-parse-better-errors "^1.0.2" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.2.0" + webpack-sources "^2.3.1" + websocket@^1.0.34: version "1.0.34" resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" @@ -150,7 +1090,39 @@ websocket@^1.0.34: utf-8-validate "^5.0.2" yaeti "^0.0.6" +which@^2.0.1, which@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wildcard@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== + yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zx@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/zx/-/zx-2.0.0.tgz#08b11222a26fd160e234552fd54bb486ec6e81b9" + integrity sha512-OF8YvqseMMmtDaASqO+8+0/tJZvykLK0hX9YBAaRO9l7Hc+YjNKjpgJTjrmncgEURoyDr9Ln4r/qBtEuDNZstg== + dependencies: + "@types/fs-extra" "^9.0.11" + "@types/minimist" "^1.2.1" + "@types/node" "^16.0" + "@types/node-fetch" "^2.5.10" + chalk "^4.1.1" + fs-extra "^10.0.0" + minimist "^1.2.5" + node-fetch "^2.6.1" + which "^2.0.2"