From 101cf6005732d3d63eb0ea0fe8048cee26e6f074 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 16 Sep 2021 20:09:05 -0700 Subject: [PATCH] Add shortlinks action (task 2 in #789) --- .actions/README.md | 2 + .actions/build/LICENSE | 578 ++++++++++++++++++ .actions/build/index.js | 7 + .actions/package.json | 22 + .actions/src/shortlinks.ts | 83 +++ .actions/tsconfig.json | 14 + .actions/yarn.lock | 173 ++++++ .github/workflows/ESLint.yml | 5 + .../workflows/{prod.yml => Production.yml} | 0 .github/workflows/Shortlinks.yml | 19 + .github/workflows/{edge.yml => Staging.yml} | 0 .gitignore | 1 + .prettierignore | 3 + prisma/schema.prisma | 19 +- scripts/migrations/v1.js | 81 --- scripts/migrator/v0.js | 0 scripts/migrator/v1.js | 0 scripts/shortlinks.js | 15 +- scripts/update-punishments.js | 94 --- scripts/util/getCaseType.js | 50 -- scripts/util/getRepositories.js | 51 -- 21 files changed, 927 insertions(+), 290 deletions(-) create mode 100644 .actions/README.md create mode 100644 .actions/build/LICENSE create mode 100644 .actions/build/index.js create mode 100644 .actions/package.json create mode 100644 .actions/src/shortlinks.ts create mode 100644 .actions/tsconfig.json create mode 100644 .actions/yarn.lock rename .github/workflows/{prod.yml => Production.yml} (100%) create mode 100644 .github/workflows/Shortlinks.yml rename .github/workflows/{edge.yml => Staging.yml} (100%) delete mode 100644 scripts/migrations/v1.js create mode 100644 scripts/migrator/v0.js create mode 100644 scripts/migrator/v1.js delete mode 100644 scripts/update-punishments.js delete mode 100644 scripts/util/getCaseType.js delete mode 100644 scripts/util/getRepositories.js diff --git a/.actions/README.md b/.actions/README.md new file mode 100644 index 00000000..70c83dbe --- /dev/null +++ b/.actions/README.md @@ -0,0 +1,2 @@ +# .actions/ folder +> This is where any miscellaneous GitHub actions are ran with Nino. diff --git a/.actions/build/LICENSE b/.actions/build/LICENSE new file mode 100644 index 00000000..a7409722 --- /dev/null +++ b/.actions/build/LICENSE @@ -0,0 +1,578 @@ +@actions/core +MIT +The MIT License (MIT) + +Copyright 2019 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +@actions/github +MIT +The MIT License (MIT) + +Copyright 2019 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +@actions/http-client +MIT +Actions Http Client for Node.js + +Copyright (c) GitHub, Inc. + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +@octokit/auth-token +MIT +The MIT License + +Copyright (c) 2019 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@octokit/core +MIT +The MIT License + +Copyright (c) 2019 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@octokit/endpoint +MIT +The MIT License + +Copyright (c) 2018 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@octokit/graphql +MIT +The MIT License + +Copyright (c) 2018 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@octokit/plugin-paginate-rest +MIT +MIT License Copyright (c) 2019 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +@octokit/plugin-rest-endpoint-methods +MIT +MIT License Copyright (c) 2019 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +@octokit/request +MIT +The MIT License + +Copyright (c) 2018 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@octokit/request-error +MIT +The MIT License + +Copyright (c) 2019 Octokit contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@vercel/ncc +MIT +Copyright 2018 ZEIT, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +before-after-hook +Apache-2.0 + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 Gregor Martynus and other contributors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +deprecation +ISC +The ISC License + +Copyright (c) Gregor Martynus and contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +is-plain-object +MIT +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +node-fetch +MIT +The MIT License (MIT) + +Copyright (c) 2016 David Frank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +once +ISC +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +tunnel +MIT +The MIT License (MIT) + +Copyright (c) 2012 Koichi Kobayashi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +universal-user-agent +ISC +# [ISC License](https://spdx.org/licenses/ISC) + +Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m) + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +wrappy +ISC +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/.actions/build/index.js b/.actions/build/index.js new file mode 100644 index 00000000..4e9c7877 --- /dev/null +++ b/.actions/build/index.js @@ -0,0 +1,7 @@ +(()=>{var __webpack_modules__={351:function(e,r,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,r,t,s){if(s===undefined)s=t;Object.defineProperty(e,s,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,s){if(s===undefined)s=t;e[s]=r[t]});var o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}:function(e,r){e["default"]=r});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(t!=="default"&&Object.hasOwnProperty.call(e,t))s(r,e,t);o(r,e);return r};Object.defineProperty(r,"__esModule",{value:true});r.issue=r.issueCommand=void 0;const i=n(t(365));const a=t(278);function issueCommand(e,r,t){const s=new Command(e,r,t);process.stdout.write(s.toString()+i.EOL)}r.issueCommand=issueCommand;function issue(e,r=""){issueCommand(e,{},r)}r.issue=issue;const c="::";class Command{constructor(e,r,t){if(!e){e="missing.command"}this.command=e;this.properties=r;this.message=t}toString(){let e=c+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let r=true;for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const s=this.properties[t];if(s){if(r){r=false}else{e+=","}e+=`${t}=${escapeProperty(s)}`}}}}e+=`${c}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},186:function(e,r,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,r,t,s){if(s===undefined)s=t;Object.defineProperty(e,s,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,s){if(s===undefined)s=t;e[s]=r[t]});var o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}:function(e,r){e["default"]=r});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(t!=="default"&&Object.hasOwnProperty.call(e,t))s(r,e,t);o(r,e);return r};var i=this&&this.__awaiter||function(e,r,t,s){function adopt(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,o){function fulfilled(e){try{step(s.next(e))}catch(e){o(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){o(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.getState=r.saveState=r.group=r.endGroup=r.startGroup=r.info=r.notice=r.warning=r.error=r.debug=r.isDebug=r.setFailed=r.setCommandEcho=r.setOutput=r.getBooleanInput=r.getMultilineInput=r.getInput=r.addPath=r.setSecret=r.exportVariable=r.ExitCode=void 0;const a=t(351);const c=t(717);const u=t(278);const p=n(t(365));const l=n(t(622));var d;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(d=r.ExitCode||(r.ExitCode={}));function exportVariable(e,r){const t=u.toCommandValue(r);process.env[e]=t;const s=process.env["GITHUB_ENV"]||"";if(s){const r="_GitHubActionsFileCommandDelimeter_";const s=`${e}<<${r}${p.EOL}${t}${p.EOL}${r}`;c.issueCommand("ENV",s)}else{a.issueCommand("set-env",{name:e},t)}}r.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}r.setSecret=setSecret;function addPath(e){const r=process.env["GITHUB_PATH"]||"";if(r){c.issueCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${l.delimiter}${process.env["PATH"]}`}r.addPath=addPath;function getInput(e,r){const t=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(r&&r.required&&!t){throw new Error(`Input required and not supplied: ${e}`)}if(r&&r.trimWhitespace===false){return t}return t.trim()}r.getInput=getInput;function getMultilineInput(e,r){const t=getInput(e,r).split("\n").filter((e=>e!==""));return t}r.getMultilineInput=getMultilineInput;function getBooleanInput(e,r){const t=["true","True","TRUE"];const s=["false","False","FALSE"];const o=getInput(e,r);if(t.includes(o))return true;if(s.includes(o))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}r.getBooleanInput=getBooleanInput;function setOutput(e,r){process.stdout.write(p.EOL);a.issueCommand("set-output",{name:e},r)}r.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}r.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=d.Failure;error(e)}r.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}r.isDebug=isDebug;function debug(e){a.issueCommand("debug",{},e)}r.debug=debug;function error(e,r={}){a.issueCommand("error",u.toCommandProperties(r),e instanceof Error?e.toString():e)}r.error=error;function warning(e,r={}){a.issueCommand("warning",u.toCommandProperties(r),e instanceof Error?e.toString():e)}r.warning=warning;function notice(e,r={}){a.issueCommand("notice",u.toCommandProperties(r),e instanceof Error?e.toString():e)}r.notice=notice;function info(e){process.stdout.write(e+p.EOL)}r.info=info;function startGroup(e){a.issue("group",e)}r.startGroup=startGroup;function endGroup(){a.issue("endgroup")}r.endGroup=endGroup;function group(e,r){return i(this,void 0,void 0,(function*(){startGroup(e);let t;try{t=yield r()}finally{endGroup()}return t}))}r.group=group;function saveState(e,r){a.issueCommand("save-state",{name:e},r)}r.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}r.getState=getState},717:function(e,r,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,r,t,s){if(s===undefined)s=t;Object.defineProperty(e,s,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,s){if(s===undefined)s=t;e[s]=r[t]});var o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}:function(e,r){e["default"]=r});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(t!=="default"&&Object.hasOwnProperty.call(e,t))s(r,e,t);o(r,e);return r};Object.defineProperty(r,"__esModule",{value:true});r.issueCommand=void 0;const i=n(t(747));const a=n(t(365));const c=t(278);function issueCommand(e,r){const t=process.env[`GITHUB_${e}`];if(!t){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!i.existsSync(t)){throw new Error(`Missing file at path: ${t}`)}i.appendFileSync(t,`${c.toCommandValue(r)}${a.EOL}`,{encoding:"utf8"})}r.issueCommand=issueCommand},278:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.toCommandProperties=r.toCommandValue=void 0;function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}r.toCommandValue=toCommandValue;function toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}r.toCommandProperties=toCommandProperties},87:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Context=void 0;const s=t(747);const o=t(365);class Context{constructor(){var e,r,t;this.payload={};if(process.env.GITHUB_EVENT_PATH){if(s.existsSync(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse(s.readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${o.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10);this.runId=parseInt(process.env.GITHUB_RUN_ID,10);this.apiUrl=(e=process.env.GITHUB_API_URL)!==null&&e!==void 0?e:`https://api.github.com`;this.serverUrl=(r=process.env.GITHUB_SERVER_URL)!==null&&r!==void 0?r:`https://github.com`;this.graphqlUrl=(t=process.env.GITHUB_GRAPHQL_URL)!==null&&t!==void 0?t:`https://api.github.com/graphql`}get issue(){const e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){const[e,r]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:r}}if(this.payload.repository){return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name}}throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}}r.Context=Context},438:function(e,r,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,r,t,s){if(s===undefined)s=t;Object.defineProperty(e,s,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,s){if(s===undefined)s=t;e[s]=r[t]});var o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}:function(e,r){e["default"]=r});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(t!=="default"&&Object.hasOwnProperty.call(e,t))s(r,e,t);o(r,e);return r};Object.defineProperty(r,"__esModule",{value:true});r.getOctokit=r.context=void 0;const i=n(t(87));const a=t(30);r.context=new i.Context;function getOctokit(e,r){return new a.GitHub(a.getOctokitOptions(e,r))}r.getOctokit=getOctokit},914:function(e,r,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,r,t,s){if(s===undefined)s=t;Object.defineProperty(e,s,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,s){if(s===undefined)s=t;e[s]=r[t]});var o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}:function(e,r){e["default"]=r});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(t!=="default"&&Object.hasOwnProperty.call(e,t))s(r,e,t);o(r,e);return r};Object.defineProperty(r,"__esModule",{value:true});r.getApiBaseUrl=r.getProxyAgent=r.getAuthString=void 0;const i=n(t(925));function getAuthString(e,r){if(!e&&!r.auth){throw new Error("Parameter token or opts.auth is required")}else if(e&&r.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof r.auth==="string"?r.auth:`token ${e}`}r.getAuthString=getAuthString;function getProxyAgent(e){const r=new i.HttpClient;return r.getAgent(e)}r.getProxyAgent=getProxyAgent;function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}r.getApiBaseUrl=getApiBaseUrl},30:function(e,r,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,r,t,s){if(s===undefined)s=t;Object.defineProperty(e,s,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,s){if(s===undefined)s=t;e[s]=r[t]});var o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:true,value:r})}:function(e,r){e["default"]=r});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(t!=="default"&&Object.hasOwnProperty.call(e,t))s(r,e,t);o(r,e);return r};Object.defineProperty(r,"__esModule",{value:true});r.getOctokitOptions=r.GitHub=r.context=void 0;const i=n(t(87));const a=n(t(914));const c=t(762);const u=t(44);const p=t(193);r.context=new i.Context;const l=a.getApiBaseUrl();const d={baseUrl:l,request:{agent:a.getProxyAgent(l)}};r.GitHub=c.Octokit.plugin(u.restEndpointMethods,p.paginateRest).defaults(d);function getOctokitOptions(e,r){const t=Object.assign({},r||{});const s=a.getAuthString(e,t);if(s){t.auth=s}return t}r.getOctokitOptions=getOctokitOptions},925:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const s=t(605);const o=t(211);const n=t(443);let i;var a;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(a=r.HttpCodes||(r.HttpCodes={}));var c;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(c=r.Headers||(r.Headers={}));var u;(function(e){e["ApplicationJson"]="application/json"})(u=r.MediaTypes||(r.MediaTypes={}));function getProxyUrl(e){let r=n.getProxyUrl(new URL(e));return r?r.href:""}r.getProxyUrl=getProxyUrl;const p=[a.MovedPermanently,a.ResourceMoved,a.SeeOther,a.TemporaryRedirect,a.PermanentRedirect];const l=[a.BadGateway,a.ServiceUnavailable,a.GatewayTimeout];const d=["OPTIONS","GET","DELETE","HEAD"];const m=10;const g=5;class HttpClientError extends Error{constructor(e,r){super(e);this.name="HttpClientError";this.statusCode=r;Object.setPrototypeOf(this,HttpClientError.prototype)}}r.HttpClientError=HttpClientError;class HttpClientResponse{constructor(e){this.message=e}readBody(){return new Promise((async(e,r)=>{let t=Buffer.alloc(0);this.message.on("data",(e=>{t=Buffer.concat([t,e])}));this.message.on("end",(()=>{e(t.toString())}))}))}}r.HttpClientResponse=HttpClientResponse;function isHttps(e){let r=new URL(e);return r.protocol==="https:"}r.isHttps=isHttps;class HttpClient{constructor(e,r,t){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=e;this.handlers=r||[];this.requestOptions=t;if(t){if(t.ignoreSslError!=null){this._ignoreSslError=t.ignoreSslError}this._socketTimeout=t.socketTimeout;if(t.allowRedirects!=null){this._allowRedirects=t.allowRedirects}if(t.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=t.allowRedirectDowngrade}if(t.maxRedirects!=null){this._maxRedirects=Math.max(t.maxRedirects,0)}if(t.keepAlive!=null){this._keepAlive=t.keepAlive}if(t.allowRetries!=null){this._allowRetries=t.allowRetries}if(t.maxRetries!=null){this._maxRetries=t.maxRetries}}}options(e,r){return this.request("OPTIONS",e,null,r||{})}get(e,r){return this.request("GET",e,null,r||{})}del(e,r){return this.request("DELETE",e,null,r||{})}post(e,r,t){return this.request("POST",e,r,t||{})}patch(e,r,t){return this.request("PATCH",e,r,t||{})}put(e,r,t){return this.request("PUT",e,r,t||{})}head(e,r){return this.request("HEAD",e,null,r||{})}sendStream(e,r,t,s){return this.request(e,r,t,s)}async getJson(e,r={}){r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);let t=await this.get(e,r);return this._processResponse(t,this.requestOptions)}async postJson(e,r,t={}){let s=JSON.stringify(r,null,2);t[c.Accept]=this._getExistingOrDefaultHeader(t,c.Accept,u.ApplicationJson);t[c.ContentType]=this._getExistingOrDefaultHeader(t,c.ContentType,u.ApplicationJson);let o=await this.post(e,s,t);return this._processResponse(o,this.requestOptions)}async putJson(e,r,t={}){let s=JSON.stringify(r,null,2);t[c.Accept]=this._getExistingOrDefaultHeader(t,c.Accept,u.ApplicationJson);t[c.ContentType]=this._getExistingOrDefaultHeader(t,c.ContentType,u.ApplicationJson);let o=await this.put(e,s,t);return this._processResponse(o,this.requestOptions)}async patchJson(e,r,t={}){let s=JSON.stringify(r,null,2);t[c.Accept]=this._getExistingOrDefaultHeader(t,c.Accept,u.ApplicationJson);t[c.ContentType]=this._getExistingOrDefaultHeader(t,c.ContentType,u.ApplicationJson);let o=await this.patch(e,s,t);return this._processResponse(o,this.requestOptions)}async request(e,r,t,s){if(this._disposed){throw new Error("Client has already been disposed.")}let o=new URL(r);let n=this._prepareRequest(e,o,s);let i=this._allowRetries&&d.indexOf(e)!=-1?this._maxRetries+1:1;let c=0;let u;while(c0){const i=u.message.headers["location"];if(!i){break}let a=new URL(i);if(o.protocol=="https:"&&o.protocol!=a.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}await u.readBody();if(a.hostname!==o.hostname){for(let e in s){if(e.toLowerCase()==="authorization"){delete s[e]}}}n=this._prepareRequest(e,a,s);u=await this.requestRaw(n,t);r--}if(l.indexOf(u.message.statusCode)==-1){return u}c+=1;if(c{let callbackForResult=function(e,r){if(e){s(e)}t(r)};this.requestRawWithCallback(e,r,callbackForResult)}))}requestRawWithCallback(e,r,t){let s;if(typeof r==="string"){e.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8")}let o=false;let handleResult=(e,r)=>{if(!o){o=true;t(e,r)}};let n=e.httpModule.request(e.options,(e=>{let r=new HttpClientResponse(e);handleResult(null,r)}));n.on("socket",(e=>{s=e}));n.setTimeout(this._socketTimeout||3*6e4,(()=>{if(s){s.end()}handleResult(new Error("Request timeout: "+e.options.path),null)}));n.on("error",(function(e){handleResult(e,null)}));if(r&&typeof r==="string"){n.write(r,"utf8")}if(r&&typeof r!=="string"){r.on("close",(function(){n.end()}));r.pipe(n)}else{n.end()}}getAgent(e){let r=new URL(e);return this._getAgent(r)}_prepareRequest(e,r,t){const n={};n.parsedUrl=r;const i=n.parsedUrl.protocol==="https:";n.httpModule=i?o:s;const a=i?443:80;n.options={};n.options.host=n.parsedUrl.hostname;n.options.port=n.parsedUrl.port?parseInt(n.parsedUrl.port):a;n.options.path=(n.parsedUrl.pathname||"")+(n.parsedUrl.search||"");n.options.method=e;n.options.headers=this._mergeHeaders(t);if(this.userAgent!=null){n.options.headers["user-agent"]=this.userAgent}n.options.agent=this._getAgent(n.parsedUrl);if(this.handlers){this.handlers.forEach((e=>{e.prepareRequest(n.options)}))}return n}_mergeHeaders(e){const lowercaseKeys=e=>Object.keys(e).reduce(((r,t)=>(r[t.toLowerCase()]=e[t],r)),{});if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,r,t){const lowercaseKeys=e=>Object.keys(e).reduce(((r,t)=>(r[t.toLowerCase()]=e[t],r)),{});let s;if(this.requestOptions&&this.requestOptions.headers){s=lowercaseKeys(this.requestOptions.headers)[r]}return e[r]||s||t}_getAgent(e){let r;let a=n.getProxyUrl(e);let c=a&&a.hostname;if(this._keepAlive&&c){r=this._proxyAgent}if(this._keepAlive&&!c){r=this._agent}if(!!r){return r}const u=e.protocol==="https:";let p=100;if(!!this.requestOptions){p=this.requestOptions.maxSockets||s.globalAgent.maxSockets}if(c){if(!i){i=t(294)}const e={maxSockets:p,keepAlive:this._keepAlive,proxy:{...(a.username||a.password)&&{proxyAuth:`${a.username}:${a.password}`},host:a.hostname,port:a.port}};let s;const o=a.protocol==="https:";if(u){s=o?i.httpsOverHttps:i.httpsOverHttp}else{s=o?i.httpOverHttps:i.httpOverHttp}r=s(e);this._proxyAgent=r}if(this._keepAlive&&!r){const e={keepAlive:this._keepAlive,maxSockets:p};r=u?new o.Agent(e):new s.Agent(e);this._agent=r}if(!r){r=u?o.globalAgent:s.globalAgent}if(u&&this._ignoreSslError){r.options=Object.assign(r.options||{},{rejectUnauthorized:false})}return r}_performExponentialBackoff(e){e=Math.min(m,e);const r=g*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),r)))}static dateTimeDeserializer(e,r){if(typeof r==="string"){let e=new Date(r);if(!isNaN(e.valueOf())){return e}}return r}async _processResponse(e,r){return new Promise((async(t,s)=>{const o=e.message.statusCode;const n={statusCode:o,result:null,headers:{}};if(o==a.NotFound){t(n)}let i;let c;try{c=await e.readBody();if(c&&c.length>0){if(r&&r.deserializeDates){i=JSON.parse(c,HttpClient.dateTimeDeserializer)}else{i=JSON.parse(c)}n.result=i}n.headers=e.message.headers}catch(e){}if(o>299){let e;if(i&&i.message){e=i.message}else if(c&&c.length>0){e=c}else{e="Failed request: ("+o+")"}let r=new HttpClientError(e,o);r.result=n.result;s(r)}else{t(n)}}))}}r.HttpClient=HttpClient},443:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function getProxyUrl(e){let r=e.protocol==="https:";let t;if(checkBypass(e)){return t}let s;if(r){s=process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{s=process.env["http_proxy"]||process.env["HTTP_PROXY"]}if(s){t=new URL(s)}return t}r.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}let r=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!r){return false}let t;if(e.port){t=Number(e.port)}else if(e.protocol==="http:"){t=80}else if(e.protocol==="https:"){t=443}let s=[e.hostname.toUpperCase()];if(typeof t==="number"){s.push(`${s[0]}:${t}`)}for(let e of r.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(s.some((r=>r===e))){return true}}return false}r.checkBypass=checkBypass},334:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const t=/^v1\./;const s=/^ghs_/;const o=/^ghu_/;async function auth(e){const r=e.split(/\./).length===3;const n=t.test(e)||s.test(e);const i=o.test(e);const a=r?"app":n?"installation":i?"user-to-server":"oauth";return{type:"token",token:e,tokenType:a}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,r,t,s){const o=r.endpoint.merge(t,s);o.headers.authorization=withAuthorizationPrefix(e);return r(o)}const n=function createTokenAuth(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};r.createTokenAuth=n},762:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var s=t(429);var o=t(682);var n=t(234);var i=t(668);var a=t(334);function _objectWithoutPropertiesLoose(e,r){if(e==null)return{};var t={};var s=Object.keys(e);var o,n;for(n=0;n=0)continue;t[o]=e[o]}return t}function _objectWithoutProperties(e,r){if(e==null)return{};var t=_objectWithoutPropertiesLoose(e,r);var s,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,s))continue;t[s]=e[s]}}return t}const c="3.5.1";const u=["authStrategy"];class Octokit{constructor(e={}){const r=new o.Collection;const t={baseUrl:n.request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};t.headers["user-agent"]=[e.userAgent,`octokit-core.js/${c} ${s.getUserAgent()}`].filter(Boolean).join(" ");if(e.baseUrl){t.baseUrl=e.baseUrl}if(e.previews){t.mediaType.previews=e.previews}if(e.timeZone){t.headers["time-zone"]=e.timeZone}this.request=n.request.defaults(t);this.graphql=i.withCustomRequest(this.request).defaults(t);this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log);this.hook=r;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const t=a.createTokenAuth(e.auth);r.wrap("request",t.hook);this.auth=t}}else{const{authStrategy:t}=e,s=_objectWithoutProperties(e,u);const o=t(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},e.auth));r.wrap("request",o.hook);this.auth=o}const p=this.constructor;p.plugins.forEach((r=>{Object.assign(this,r(this,e))}))}static defaults(e){const r=class extends(this){constructor(...r){const t=r[0]||{};if(typeof e==="function"){super(e(t));return}super(Object.assign({},e,t,t.userAgent&&e.userAgent?{userAgent:`${t.userAgent} ${e.userAgent}`}:null))}};return r}static plugin(...e){var r;const t=this.plugins;const s=(r=class extends(this){},r.plugins=t.concat(e.filter((e=>!t.includes(e)))),r);return s}}Octokit.VERSION=c;Octokit.plugins=[];r.Octokit=Octokit},440:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var s=t(287);var o=t(429);function lowercaseKeys(e){if(!e){return{}}return Object.keys(e).reduce(((r,t)=>{r[t.toLowerCase()]=e[t];return r}),{})}function mergeDeep(e,r){const t=Object.assign({},e);Object.keys(r).forEach((o=>{if(s.isPlainObject(r[o])){if(!(o in e))Object.assign(t,{[o]:r[o]});else t[o]=mergeDeep(e[o],r[o])}else{Object.assign(t,{[o]:r[o]})}}));return t}function removeUndefinedProperties(e){for(const r in e){if(e[r]===undefined){delete e[r]}}return e}function merge(e,r,t){if(typeof r==="string"){let[e,s]=r.split(" ");t=Object.assign(s?{method:e,url:s}:{url:e},t)}else{t=Object.assign({},r)}t.headers=lowercaseKeys(t.headers);removeUndefinedProperties(t);removeUndefinedProperties(t.headers);const s=mergeDeep(e||{},t);if(e&&e.mediaType.previews.length){s.mediaType.previews=e.mediaType.previews.filter((e=>!s.mediaType.previews.includes(e))).concat(s.mediaType.previews)}s.mediaType.previews=s.mediaType.previews.map((e=>e.replace(/-preview/,"")));return s}function addQueryParameters(e,r){const t=/\?/.test(e)?"&":"?";const s=Object.keys(r);if(s.length===0){return e}return e+t+s.map((e=>{if(e==="q"){return"q="+r.q.split("+").map(encodeURIComponent).join("+")}return`${e}=${encodeURIComponent(r[e])}`})).join("&")}const n=/\{[^}]+\}/g;function removeNonChars(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function extractUrlVariableNames(e){const r=e.match(n);if(!r){return[]}return r.map(removeNonChars).reduce(((e,r)=>e.concat(r)),[])}function omit(e,r){return Object.keys(e).filter((e=>!r.includes(e))).reduce(((r,t)=>{r[t]=e[t];return r}),{})}function encodeReserved(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map((function(e){if(!/%[0-9A-Fa-f]/.test(e)){e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")}return e})).join("")}function encodeUnreserved(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function encodeValue(e,r,t){r=e==="+"||e==="#"?encodeReserved(r):encodeUnreserved(r);if(t){return encodeUnreserved(t)+"="+r}else{return r}}function isDefined(e){return e!==undefined&&e!==null}function isKeyOperator(e){return e===";"||e==="&"||e==="?"}function getValues(e,r,t,s){var o=e[t],n=[];if(isDefined(o)&&o!==""){if(typeof o==="string"||typeof o==="number"||typeof o==="boolean"){o=o.toString();if(s&&s!=="*"){o=o.substring(0,parseInt(s,10))}n.push(encodeValue(r,o,isKeyOperator(r)?t:""))}else{if(s==="*"){if(Array.isArray(o)){o.filter(isDefined).forEach((function(e){n.push(encodeValue(r,e,isKeyOperator(r)?t:""))}))}else{Object.keys(o).forEach((function(e){if(isDefined(o[e])){n.push(encodeValue(r,o[e],e))}}))}}else{const e=[];if(Array.isArray(o)){o.filter(isDefined).forEach((function(t){e.push(encodeValue(r,t))}))}else{Object.keys(o).forEach((function(t){if(isDefined(o[t])){e.push(encodeUnreserved(t));e.push(encodeValue(r,o[t].toString()))}}))}if(isKeyOperator(r)){n.push(encodeUnreserved(t)+"="+e.join(","))}else if(e.length!==0){n.push(e.join(","))}}}}else{if(r===";"){if(isDefined(o)){n.push(encodeUnreserved(t))}}else if(o===""&&(r==="&"||r==="?")){n.push(encodeUnreserved(t)+"=")}else if(o===""){n.push("")}}return n}function parseUrl(e){return{expand:expand.bind(null,e)}}function expand(e,r){var t=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,s,o){if(s){let e="";const o=[];if(t.indexOf(s.charAt(0))!==-1){e=s.charAt(0);s=s.substr(1)}s.split(/,/g).forEach((function(t){var s=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);o.push(getValues(r,e,s[1],s[2]||s[3]))}));if(e&&e!=="+"){var n=",";if(e==="?"){n="&"}else if(e!=="#"){n=e}return(o.length!==0?e:"")+o.join(n)}else{return o.join(",")}}else{return encodeReserved(o)}}))}function parse(e){let r=e.method.toUpperCase();let t=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let s=Object.assign({},e.headers);let o;let n=omit(e,["method","baseUrl","url","headers","request","mediaType"]);const i=extractUrlVariableNames(t);t=parseUrl(t).expand(n);if(!/^http/.test(t)){t=e.baseUrl+t}const a=Object.keys(e).filter((e=>i.includes(e))).concat("baseUrl");const c=omit(n,a);const u=/application\/octet-stream/i.test(s.accept);if(!u){if(e.mediaType.format){s.accept=s.accept.split(/,/).map((r=>r.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`))).join(",")}if(e.mediaType.previews.length){const r=s.accept.match(/[\w-]+(?=-preview)/g)||[];s.accept=r.concat(e.mediaType.previews).map((r=>{const t=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${r}-preview${t}`})).join(",")}}if(["GET","HEAD"].includes(r)){t=addQueryParameters(t,c)}else{if("data"in c){o=c.data}else{if(Object.keys(c).length){o=c}else{s["content-length"]=0}}}if(!s["content-type"]&&typeof o!=="undefined"){s["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(r)&&typeof o==="undefined"){o=""}return Object.assign({method:r,url:t,headers:s},typeof o!=="undefined"?{body:o}:null,e.request?{request:e.request}:null)}function endpointWithDefaults(e,r,t){return parse(merge(e,r,t))}function withDefaults(e,r){const t=merge(e,r);const s=endpointWithDefaults.bind(null,t);return Object.assign(s,{DEFAULTS:t,defaults:withDefaults.bind(null,t),merge:merge.bind(null,t),parse:parse})}const i="6.0.12";const a=`octokit-endpoint.js/${i} ${o.getUserAgent()}`;const c={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":a},mediaType:{format:"",previews:[]}};const u=withDefaults(null,c);r.endpoint=u},668:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});var s=t(234);var o=t(429);const n="4.8.0";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map((e=>` - ${e.message}`)).join("\n")}class GraphqlResponseError extends Error{constructor(e,r,t){super(_buildMessageForResponseErrors(t));this.request=e;this.headers=r;this.response=t;this.name="GraphqlResponseError";this.errors=t.errors;this.data=t.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}const i=["method","baseUrl","url","headers","request","query","mediaType"];const a=["query","method","url"];const c=/\/api\/v3\/?$/;function graphql(e,r,t){if(t){if(typeof r==="string"&&"query"in t){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in t){if(!a.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const s=typeof r==="string"?Object.assign({query:r},t):r;const o=Object.keys(s).reduce(((e,r)=>{if(i.includes(r)){e[r]=s[r];return e}if(!e.variables){e.variables={}}e.variables[r]=s[r];return e}),{});const n=s.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(c.test(n)){o.url=n.replace(c,"/api/graphql")}return e(o).then((e=>{if(e.data.errors){const r={};for(const t of Object.keys(e.headers)){r[t]=e.headers[t]}throw new GraphqlResponseError(o,r,e.data)}return e.data.data}))}function withDefaults(e,r){const t=e.defaults(r);const newApi=(e,r)=>graphql(t,e,r);return Object.assign(newApi,{defaults:withDefaults.bind(null,t),endpoint:s.request.endpoint})}const u=withDefaults(s.request,{headers:{"user-agent":`octokit-graphql.js/${n} ${o.getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return withDefaults(e,{method:"POST",url:"/graphql"})}r.GraphqlResponseError=GraphqlResponseError;r.graphql=u;r.withCustomRequest=withCustomRequest},193:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const t="2.16.3";function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);if(r){s=s.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))}t.push.apply(t,s)}return t}function _objectSpread2(e){for(var r=1;r({async next(){if(!a)return{done:true};try{const e=await o({method:n,url:a,headers:i});const r=normalizePaginatedListResponse(e);a=((r.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1];return{value:r}}catch(e){if(e.status!==409)throw e;a="";return{value:{status:200,headers:{},data:[]}}}}})}}function paginate(e,r,t,s){if(typeof t==="function"){s=t;t=undefined}return gather(e,[],iterator(e,r,t)[Symbol.asyncIterator](),s)}function gather(e,r,t,s){return t.next().then((o=>{if(o.done){return r}let n=false;function done(){n=true}r=r.concat(s?s(o.value,done):o.value.data);if(n){return r}return gather(e,r,t,s)}))}const s=Object.assign(paginate,{iterator:iterator});const o=["GET /app/hook/deliveries","GET /app/installations","GET /applications/grants","GET /authorizations","GET /enterprises/{enterprise}/actions/permissions/organizations","GET /enterprises/{enterprise}/actions/runner-groups","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners","GET /enterprises/{enterprise}/actions/runners","GET /enterprises/{enterprise}/actions/runners/downloads","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/runners/downloads","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/blocks","GET /orgs/{org}/credential-authorizations","GET /orgs/{org}/events","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/projects","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/team-sync/groups","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/columns/{column_id}/cards","GET /projects/{project_id}/collaborators","GET /projects/{project_id}/columns","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runners/downloads","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/autolinks","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/git/matching-refs/{ref}","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repositories","GET /repositories/{repository_id}/environments/{environment_name}/secrets","GET /scim/v2/enterprises/{enterprise}/Groups","GET /scim/v2/enterprises/{enterprise}/Users","GET /scim/v2/organizations/{org}/Users","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/team-sync/group-mappings","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /user/{username}/packages","GET /users","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/projects","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return o.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=t;r.composePaginateRest=s;r.isPaginatingEndpoint=isPaginatingEndpoint;r.paginateRest=paginateRest;r.paginatingEndpoints=o},44:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);if(r){s=s.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))}t.push.apply(t,s)}return t}function _objectSpread2(e){for(var r=1;r{"use strict";Object.defineProperty(r,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var s=t(932);var o=_interopDefault(t(223));const n=o((e=>console.warn(e)));const i=o((e=>console.warn(e)));class RequestError extends Error{constructor(e,r,t){super(e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="HttpError";this.status=r;let o;if("headers"in t&&typeof t.headers!=="undefined"){o=t.headers}if("response"in t){this.response=t.response;o=t.response.headers}const a=Object.assign({},t.request);if(t.request.headers.authorization){a.headers=Object.assign({},t.request.headers,{authorization:t.request.headers.authorization.replace(/ .*$/," [REDACTED]")})}a.url=a.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=a;Object.defineProperty(this,"code",{get(){n(new s.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));return r}});Object.defineProperty(this,"headers",{get(){i(new s.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));return o||{}}})}}r.RequestError=RequestError},234:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var s=t(440);var o=t(429);var n=t(287);var i=_interopDefault(t(467));var a=t(537);const c="5.6.1";function getBufferResponse(e){return e.arrayBuffer()}function fetchWrapper(e){const r=e.request&&e.request.log?e.request.log:console;if(n.isPlainObject(e.body)||Array.isArray(e.body)){e.body=JSON.stringify(e.body)}let t={};let s;let o;const c=e.request&&e.request.fetch||i;return c(e.url,Object.assign({method:e.method,body:e.body,headers:e.headers,redirect:e.redirect},e.request)).then((async n=>{o=n.url;s=n.status;for(const e of n.headers){t[e[0]]=e[1]}if("deprecation"in t){const s=t.link&&t.link.match(/<([^>]+)>; rel="deprecation"/);const o=s&&s.pop();r.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${t.sunset}${o?`. See ${o}`:""}`)}if(s===204||s===205){return}if(e.method==="HEAD"){if(s<400){return}throw new a.RequestError(n.statusText,s,{response:{url:o,status:s,headers:t,data:undefined},request:e})}if(s===304){throw new a.RequestError("Not modified",s,{response:{url:o,status:s,headers:t,data:await getResponseData(n)},request:e})}if(s>=400){const r=await getResponseData(n);const i=new a.RequestError(toErrorMessage(r),s,{response:{url:o,status:s,headers:t,data:r},request:e});throw i}return getResponseData(n)})).then((e=>({status:s,url:o,headers:t,data:e}))).catch((r=>{if(r instanceof a.RequestError)throw r;throw new a.RequestError(r.message,500,{request:e})}))}async function getResponseData(e){const r=e.headers.get("content-type");if(/application\/json/.test(r)){return e.json()}if(!r||/^text\/|charset=utf-8$/.test(r)){return e.text()}return getBufferResponse(e)}function toErrorMessage(e){if(typeof e==="string")return e;if("message"in e){if(Array.isArray(e.errors)){return`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}`}return e.message}return`Unknown error: ${JSON.stringify(e)}`}function withDefaults(e,r){const t=e.defaults(r);const newApi=function(e,r){const s=t.merge(e,r);if(!s.request||!s.request.hook){return fetchWrapper(t.parse(s))}const request=(e,r)=>fetchWrapper(t.parse(t.merge(e,r)));Object.assign(request,{endpoint:t,defaults:withDefaults.bind(null,t)});return s.request.hook(request,s)};return Object.assign(newApi,{endpoint:t,defaults:withDefaults.bind(null,t)})}const u=withDefaults(s.endpoint,{headers:{"user-agent":`octokit-request.js/${c} ${o.getUserAgent()}`}});r.request=u},682:(e,r,t)=>{var s=t(670);var o=t(549);var n=t(819);var i=Function.bind;var a=i.bind(i);function bindApi(e,r,t){var s=a(n,null).apply(null,t?[r,t]:[r]);e.api={remove:s};e.remove=s;["before","error","after","wrap"].forEach((function(s){var n=t?[r,s,t]:[r,s];e[s]=e.api[s]=a(o,null).apply(null,n)}))}function HookSingular(){var e="h";var r={registry:{}};var t=s.bind(null,r,e);bindApi(t,r,e);return t}function HookCollection(){var e={registry:{}};var r=s.bind(null,e);bindApi(r,e);return r}var c=false;function Hook(){if(!c){console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4');c=true}return HookCollection()}Hook.Singular=HookSingular.bind();Hook.Collection=HookCollection.bind();e.exports=Hook;e.exports.Hook=Hook;e.exports.Singular=Hook.Singular;e.exports.Collection=Hook.Collection},549:e=>{e.exports=addHook;function addHook(e,r,t,s){var o=s;if(!e.registry[t]){e.registry[t]=[]}if(r==="before"){s=function(e,r){return Promise.resolve().then(o.bind(null,r)).then(e.bind(null,r))}}if(r==="after"){s=function(e,r){var t;return Promise.resolve().then(e.bind(null,r)).then((function(e){t=e;return o(t,r)})).then((function(){return t}))}}if(r==="error"){s=function(e,r){return Promise.resolve().then(e.bind(null,r)).catch((function(e){return o(e,r)}))}}e.registry[t].push({hook:s,orig:o})}},670:e=>{e.exports=register;function register(e,r,t,s){if(typeof t!=="function"){throw new Error("method for before hook must be a function")}if(!s){s={}}if(Array.isArray(r)){return r.reverse().reduce((function(r,t){return register.bind(null,e,t,r,s)}),t)()}return Promise.resolve().then((function(){if(!e.registry[r]){return t(s)}return e.registry[r].reduce((function(e,r){return r.hook.bind(null,e,s)}),t)()}))}},819:e=>{e.exports=removeHook;function removeHook(e,r,t){if(!e.registry[r]){return}var s=e.registry[r].map((function(e){return e.orig})).indexOf(t);if(s===-1){return}e.registry[r].splice(s,1)}},932:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});class Deprecation extends Error{constructor(e){super(e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="Deprecation"}}r.Deprecation=Deprecation},287:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true}); +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var r,t;if(isObject(e)===false)return false;r=e.constructor;if(r===undefined)return true;t=r.prototype;if(isObject(t)===false)return false;if(t.hasOwnProperty("isPrototypeOf")===false){return false}return true}r.isPlainObject=isPlainObject},467:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var s=_interopDefault(t(413));var o=_interopDefault(t(605));var n=_interopDefault(t(835));var i=_interopDefault(t(211));var a=_interopDefault(t(761));const c=s.Readable;const u=Symbol("buffer");const p=Symbol("type");class Blob{constructor(){this[p]="";const e=arguments[0];const r=arguments[1];const t=[];let s=0;if(e){const r=e;const o=Number(r.length);for(let e=0;e1&&arguments[1]!==undefined?arguments[1]:{},o=t.size;let n=o===undefined?0:o;var i=t.timeout;let a=i===undefined?0:i;if(e==null){e=null}else if(isURLSearchParams(e)){e=Buffer.from(e.toString())}else if(isBlob(e));else if(Buffer.isBuffer(e));else if(Object.prototype.toString.call(e)==="[object ArrayBuffer]"){e=Buffer.from(e)}else if(ArrayBuffer.isView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(e instanceof s);else{e=Buffer.from(String(e))}this[d]={body:e,disturbed:false,error:null};this.size=n;this.timeout=a;if(e instanceof s){e.on("error",(function(e){const t=e.name==="AbortError"?e:new FetchError(`Invalid response body while trying to fetch ${r.url}: ${e.message}`,"system",e);r[d].error=t}))}}Body.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(r){return Object.assign(new Blob([],{type:e.toLowerCase()}),{[u]:r})}))},json(){var e=this;return consumeBody.call(this).then((function(r){try{return JSON.parse(r.toString())}catch(r){return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${r.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(e){return e.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var e=this;return consumeBody.call(this).then((function(r){return convertBody(r,e.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(e){for(const r of Object.getOwnPropertyNames(Body.prototype)){if(!(r in e)){const t=Object.getOwnPropertyDescriptor(Body.prototype,r);Object.defineProperty(e,r,t)}}};function consumeBody(){var e=this;if(this[d].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[d].disturbed=true;if(this[d].error){return Body.Promise.reject(this[d].error)}let r=this.body;if(r===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(r)){r=r.stream()}if(Buffer.isBuffer(r)){return Body.Promise.resolve(r)}if(!(r instanceof s)){return Body.Promise.resolve(Buffer.alloc(0))}let t=[];let o=0;let n=false;return new Body.Promise((function(s,i){let a;if(e.timeout){a=setTimeout((function(){n=true;i(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)}r.on("error",(function(r){if(r.name==="AbortError"){n=true;i(r)}else{i(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${r.message}`,"system",r))}}));r.on("data",(function(r){if(n||r===null){return}if(e.size&&o+r.length>e.size){n=true;i(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}o+=r.length;t.push(r)}));r.on("end",(function(){if(n){return}clearTimeout(a);try{s(Buffer.concat(t,o))}catch(r){i(new FetchError(`Could not create Buffer from response body for ${e.url}: ${r.message}`,"system",r))}}))}))}function convertBody(e,r){if(typeof l!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const t=r.get("content-type");let s="utf-8";let o,n;if(t){o=/charset=([^;]*)/i.exec(t)}n=e.slice(0,1024).toString();if(!o&&n){o=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[T]=Object.create(null);if(e instanceof Headers){const r=e.raw();const t=Object.keys(r);for(const e of t){for(const t of r[e]){this.append(e,t)}}return}if(e==null);else if(typeof e==="object"){const r=e[Symbol.iterator];if(r!=null){if(typeof r!=="function"){throw new TypeError("Header pairs must be iterable")}const t=[];for(const r of e){if(typeof r!=="object"||typeof r[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}t.push(Array.from(r))}for(const e of t){if(e.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(e[0],e[1])}}else{for(const r of Object.keys(e)){const t=e[r];this.append(r,t)}}}else{throw new TypeError("Provided initializer must be an object")}}get(e){e=`${e}`;validateName(e);const r=find(this[T],e);if(r===undefined){return null}return this[T][r].join(", ")}forEach(e){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let t=getHeaders(this);let s=0;while(s1&&arguments[1]!==undefined?arguments[1]:"key+value";const t=Object.keys(e[T]).sort();return t.map(r==="key"?function(e){return e.toLowerCase()}:r==="value"?function(r){return e[T][r].join(", ")}:function(r){return[r.toLowerCase(),e[T][r].join(", ")]})}const E=Symbol("internal");function createHeadersIterator(e,r){const t=Object.create(b);t[E]={target:e,kind:r,index:0};return t}const b=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==b){throw new TypeError("Value of `this` is not a HeadersIterator")}var e=this[E];const r=e.target,t=e.kind,s=e.index;const o=getHeaders(r,t);const n=o.length;if(s>=n){return{value:undefined,done:true}}this[E].index=s+1;return{value:o[s],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(b,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(e){const r=Object.assign({__proto__:null},e[T]);const t=find(e[T],"Host");if(t!==undefined){r[t]=r[t][0]}return r}function createHeadersLenient(e){const r=new Headers;for(const t of Object.keys(e)){if(g.test(t)){continue}if(Array.isArray(e[t])){for(const s of e[t]){if(h.test(s)){continue}if(r[T][t]===undefined){r[T][t]=[s]}else{r[T][t].push(s)}}}else if(!h.test(e[t])){r[T][t]=[e[t]]}}return r}const w=Symbol("Response internals");const _=o.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,e,r);const t=r.status||200;const s=new Headers(r.headers);if(e!=null&&!s.has("Content-Type")){const r=extractContentType(e);if(r){s.append("Content-Type",r)}}this[w]={url:r.url,status:t,statusText:r.statusText||_[t],headers:s,counter:r.counter}}get url(){return this[w].url||""}get status(){return this[w].status}get ok(){return this[w].status>=200&&this[w].status<300}get redirected(){return this[w].counter>0}get statusText(){return this[w].statusText}get headers(){return this[w].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const y=Symbol("Request internals");const v=n.parse;const k=n.format;const G="destroy"in s.Readable.prototype;function isRequest(e){return typeof e==="object"&&typeof e[y]==="object"}function isAbortSignal(e){const r=e&&typeof e==="object"&&Object.getPrototypeOf(e);return!!(r&&r.constructor.name==="AbortSignal")}class Request{constructor(e){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let t;if(!isRequest(e)){if(e&&e.href){t=v(e.href)}else{t=v(`${e}`)}e={}}else{t=v(e.url)}let s=r.method||e.method||"GET";s=s.toUpperCase();if((r.body!=null||isRequest(e)&&e.body!==null)&&(s==="GET"||s==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let o=r.body!=null?r.body:isRequest(e)&&e.body!==null?clone(e):null;Body.call(this,o,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const n=new Headers(r.headers||e.headers||{});if(o!=null&&!n.has("Content-Type")){const e=extractContentType(o);if(e){n.append("Content-Type",e)}}let i=isRequest(e)?e.signal:null;if("signal"in r)i=r.signal;if(i!=null&&!isAbortSignal(i)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[y]={method:s,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:i};this.follow=r.follow!==undefined?r.follow:e.follow!==undefined?e.follow:20;this.compress=r.compress!==undefined?r.compress:e.compress!==undefined?e.compress:true;this.counter=r.counter||e.counter||0;this.agent=r.agent||e.agent}get method(){return this[y].method}get url(){return k(this[y].parsedURL)}get headers(){return this[y].headers}get redirect(){return this[y].redirect}get signal(){return this[y].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(e){const r=e[y].parsedURL;const t=new Headers(e[y].headers);if(!t.has("Accept")){t.set("Accept","*/*")}if(!r.protocol||!r.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(r.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(e.signal&&e.body instanceof s.Readable&&!G){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let o=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)){o="0"}if(e.body!=null){const r=getTotalBytes(e);if(typeof r==="number"){o=String(r)}}if(o){t.set("Content-Length",o)}if(!t.has("User-Agent")){t.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(e.compress&&!t.has("Accept-Encoding")){t.set("Accept-Encoding","gzip,deflate")}let n=e.agent;if(typeof n==="function"){n=n(r)}if(!t.has("Connection")&&!n){t.set("Connection","close")}return Object.assign({},r,{method:e.method,headers:exportNodeCompatibleHeaders(t),agent:n})}function AbortError(e){Error.call(this,e);this.type="aborted";this.message=e;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const O=s.PassThrough;const P=n.resolve;function fetch(e,r){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(t,n){const c=new Request(e,r);const u=getNodeRequestOptions(c);const p=(u.protocol==="https:"?i:o).request;const l=c.signal;let d=null;const m=function abort(){let e=new AbortError("The user aborted a request.");n(e);if(c.body&&c.body instanceof s.Readable){c.body.destroy(e)}if(!d||!d.body)return;d.body.emit("error",e)};if(l&&l.aborted){m();return}const g=function abortAndFinalize(){m();finalize()};const h=p(u);let T;if(l){l.addEventListener("abort",g)}function finalize(){h.abort();if(l)l.removeEventListener("abort",g);clearTimeout(T)}if(c.timeout){h.once("socket",(function(e){T=setTimeout((function(){n(new FetchError(`network timeout at: ${c.url}`,"request-timeout"));finalize()}),c.timeout)}))}h.on("error",(function(e){n(new FetchError(`request to ${c.url} failed, reason: ${e.message}`,"system",e));finalize()}));h.on("response",(function(e){clearTimeout(T);const r=createHeadersLenient(e.headers);if(fetch.isRedirect(e.statusCode)){const s=r.get("Location");const o=s===null?null:P(c.url,s);switch(c.redirect){case"error":n(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${c.url}`,"no-redirect"));finalize();return;case"manual":if(o!==null){try{r.set("Location",o)}catch(e){n(e)}}break;case"follow":if(o===null){break}if(c.counter>=c.follow){n(new FetchError(`maximum redirect reached at: ${c.url}`,"max-redirect"));finalize();return}const s={headers:new Headers(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout,size:c.size};if(e.statusCode!==303&&c.body&&getTotalBytes(c)===null){n(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(e.statusCode===303||(e.statusCode===301||e.statusCode===302)&&c.method==="POST"){s.method="GET";s.body=undefined;s.headers.delete("content-length")}t(fetch(new Request(o,s)));finalize();return}}e.once("end",(function(){if(l)l.removeEventListener("abort",g)}));let s=e.pipe(new O);const o={url:c.url,status:e.statusCode,statusText:e.statusMessage,headers:r,size:c.size,timeout:c.timeout,counter:c.counter};const i=r.get("Content-Encoding");if(!c.compress||c.method==="HEAD"||i===null||e.statusCode===204||e.statusCode===304){d=new Response(s,o);t(d);return}const u={flush:a.Z_SYNC_FLUSH,finishFlush:a.Z_SYNC_FLUSH};if(i=="gzip"||i=="x-gzip"){s=s.pipe(a.createGunzip(u));d=new Response(s,o);t(d);return}if(i=="deflate"||i=="x-deflate"){const r=e.pipe(new O);r.once("data",(function(e){if((e[0]&15)===8){s=s.pipe(a.createInflate())}else{s=s.pipe(a.createInflateRaw())}d=new Response(s,o);t(d)}));return}if(i=="br"&&typeof a.createBrotliDecompress==="function"){s=s.pipe(a.createBrotliDecompress());d=new Response(s,o);t(d);return}d=new Response(s,o);t(d)}));writeToStream(h,c)}))}fetch.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};fetch.Promise=global.Promise;e.exports=r=fetch;Object.defineProperty(r,"__esModule",{value:true});r.default=r;r.Headers=Headers;r.Request=Request;r.Response=Response;r.FetchError=FetchError},223:(e,r,t)=>{var s=t(940);e.exports=s(once);e.exports.strict=s(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(e){var f=function(){if(f.called)return f.value;f.called=true;return f.value=e.apply(this,arguments)};f.called=false;return f}function onceStrict(e){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=e.apply(this,arguments)};var r=e.name||"Function wrapped with `once`";f.onceError=r+" shouldn't be called more than once";f.called=false;return f}},294:(e,r,t)=>{e.exports=t(219)},219:(e,r,t)=>{"use strict";var s=t(631);var o=t(16);var n=t(605);var i=t(211);var a=t(614);var c=t(357);var u=t(669);r.httpOverHttp=httpOverHttp;r.httpsOverHttp=httpsOverHttp;r.httpOverHttps=httpOverHttps;r.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var r=new TunnelingAgent(e);r.request=n.request;return r}function httpsOverHttp(e){var r=new TunnelingAgent(e);r.request=n.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function httpOverHttps(e){var r=new TunnelingAgent(e);r.request=i.request;return r}function httpsOverHttps(e){var r=new TunnelingAgent(e);r.request=i.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function TunnelingAgent(e){var r=this;r.options=e||{};r.proxyOptions=r.options.proxy||{};r.maxSockets=r.options.maxSockets||n.Agent.defaultMaxSockets;r.requests=[];r.sockets=[];r.on("free",(function onFree(e,t,s,o){var n=toOptions(t,s,o);for(var i=0,a=r.requests.length;i=this.maxSockets){o.requests.push(n);return}o.createSocket(n,(function(r){r.on("free",onFree);r.on("close",onCloseOrRemove);r.on("agentRemove",onCloseOrRemove);e.onSocket(r);function onFree(){o.emit("free",r,n)}function onCloseOrRemove(e){o.removeSocket(r);r.removeListener("free",onFree);r.removeListener("close",onCloseOrRemove);r.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,r){var t=this;var s={};t.sockets.push(s);var o=mergeOptions({},t.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){o.localAddress=e.localAddress}if(o.proxyAuth){o.headers=o.headers||{};o.headers["Proxy-Authorization"]="Basic "+new Buffer(o.proxyAuth).toString("base64")}p("making CONNECT request");var n=t.request(o);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,r,t){process.nextTick((function(){onConnect(e,r,t)}))}function onConnect(o,i,a){n.removeAllListeners();i.removeAllListeners();if(o.statusCode!==200){p("tunneling socket could not be established, statusCode=%d",o.statusCode);i.destroy();var c=new Error("tunneling socket could not be established, "+"statusCode="+o.statusCode);c.code="ECONNRESET";e.request.emit("error",c);t.removeSocket(s);return}if(a.length>0){p("got illegal response body from proxy");i.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);t.removeSocket(s);return}p("tunneling connection has established");t.sockets[t.sockets.indexOf(s)]=i;return r(i)}function onError(r){n.removeAllListeners();p("tunneling socket could not be established, cause=%s\n",r.message,r.stack);var o=new Error("tunneling socket could not be established, "+"cause="+r.message);o.code="ECONNRESET";e.request.emit("error",o);t.removeSocket(s)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var r=this.sockets.indexOf(e);if(r===-1){return}this.sockets.splice(r,1);var t=this.requests.shift();if(t){this.createSocket(t,(function(e){t.request.onSocket(e)}))}};function createSecureSocket(e,r){var t=this;TunnelingAgent.prototype.createSocket.call(t,e,(function(s){var n=e.request.getHeader("host");var i=mergeOptions({},t.options,{socket:s,servername:n?n.replace(/:.*$/,""):e.host});var a=o.connect(0,i);t.sockets[t.sockets.indexOf(s)]=a;r(a)}))}function toOptions(e,r,t){if(typeof e==="string"){return{host:e,port:r,localAddress:t}}return e}function mergeOptions(e){for(var r=1,t=arguments.length;r{"use strict";Object.defineProperty(r,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&"version"in process){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}r.getUserAgent=getUserAgent},940:e=>{e.exports=wrappy;function wrappy(e,r){if(e&&r)return wrappy(e)(r);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(r){wrapper[r]=e[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var t=0;t{module.exports=eval("require")("encoding")},357:e=>{"use strict";e.exports=require("assert")},614:e=>{"use strict";e.exports=require("events")},747:e=>{"use strict";e.exports=require("fs")},605:e=>{"use strict";e.exports=require("http")},211:e=>{"use strict";e.exports=require("https")},631:e=>{"use strict";e.exports=require("net")},365:e=>{"use strict";e.exports=require("os")},622:e=>{"use strict";e.exports=require("path")},413:e=>{"use strict";e.exports=require("stream")},16:e=>{"use strict";e.exports=require("tls")},835:e=>{"use strict";e.exports=require("url")},669:e=>{"use strict";e.exports=require("util")},761:e=>{"use strict";e.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var r=__webpack_module_cache__[e];if(r!==undefined){return r.exports}var t=__webpack_module_cache__[e]={exports:{}};var s=true;try{__webpack_modules__[e].call(t.exports,t,t.exports,__nccwpck_require__);s=false}finally{if(s)delete __webpack_module_cache__[e]}return t.exports}(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var e=__nccwpck_require__(438);var r=__nccwpck_require__(186);const t=require("child_process");var s=__nccwpck_require__(622);const overwriteLogger=()=>{const e={info:r.info,debug:r.debug,warn:r.warning,error:r.error};for(const t of["info","debug","warn","error"]){const s=e[t];r[t]=e=>{const r=new Date;const t=r.getHours()>=12?"PM":"AM";return s(`[${`0${r.getHours()}`.slice(-2)}:${`0${r.getMinutes()}`.slice(-2)}:${`0${r.getSeconds()}`.slice(-2)} ${t}] ${e}`)}}};const exitIfCodeExists=()=>{if(process.exitCode!==undefined)process.exit(process.exitCode)};const main=()=>{overwriteLogger();if(e.context.eventName==="push"&&e.context.payload.head_commit){if(e.context.payload.head_commit.message.includes("[skip action]")){r.info("Told to skip the action, not running.");process.exitCode=1}}exitIfCodeExists();r.info("Now running `shortlinks` action...");const o=(0,t.exec)("node scripts/shortlinks.js",{cwd:(0,s.join)(__dirname,"..","..")});o.stdout?.on("data",(e=>r.info(`\n${e}`)));o.stderr?.on("data",(e=>r.warning(`\n${e}`)));return new Promise(((e,t)=>o.on("exit",((s,o)=>{r.info(`Script exited with code ${s}${o?`, with signal ${o}`:""}.`);return s===0?e(void 0):t()}))))};main().catch((()=>process.exit(1)))})();module.exports=__webpack_exports__})(); \ No newline at end of file diff --git a/.actions/package.json b/.actions/package.json new file mode 100644 index 00000000..09c13d2d --- /dev/null +++ b/.actions/package.json @@ -0,0 +1,22 @@ +{ + "name": "@nino/actions-suite", + "description": "Miscellaneous GitHub actions tailored for Nino's repository", + "version": "0.0.0", + "license": "MIT", + "author": "Noel ", + "private": true, + "scripts": { + "build:shortlinks": "ncc build src/shortlinks.ts -o build -m -C --license LICENSE" + }, + "dependencies": { + "@actions/core": "1.5.0", + "@actions/github": "5.0.0", + "@augu/utils": "1.5.3", + "@octokit/core": "3.5.1" + }, + "devDependencies": { + "@augu/tsconfig": "1.1.1", + "@vercel/ncc": "0.31.1", + "typescript": "4.4.3" + } +} diff --git a/.actions/src/shortlinks.ts b/.actions/src/shortlinks.ts new file mode 100644 index 00000000..36800a89 --- /dev/null +++ b/.actions/src/shortlinks.ts @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2019-2021 Nino + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import * as github from '@actions/github'; +import * as core from '@actions/core'; +import { exec } from 'child_process'; +import { join } from 'path'; + +const overwriteLogger = () => { + const mapped = { + info: core.info, + debug: core.debug, + warn: core.warning, + error: core.error, + }; + + for (const key of ['info', 'debug', 'warn', 'error']) { + const mappedFn = mapped[key]; + core[key] = (message: string) => { + const date = new Date(); + const ampm = date.getHours() >= 12 ? 'PM' : 'AM'; + + return mappedFn( + `[${`0${date.getHours()}`.slice(-2)}:${`0${date.getMinutes()}`.slice(-2)}:${`0${date.getSeconds()}`.slice( + -2 + )} ${ampm}] ${message}` + ); + }; + } +}; + +const exitIfCodeExists = () => { + if (process.exitCode !== undefined) process.exit(process.exitCode); +}; + +const main = () => { + overwriteLogger(); + + if (github.context.eventName === 'push' && github.context.payload?.head_commit) { + if (github.context.payload.head_commit.message.includes('[skip action]')) { + core.info('Told to skip the action, not running.'); + process.exitCode = 1; + } + } + + exitIfCodeExists(); + core.info('Now running `shortlinks` action...'); + + const proc = exec('node scripts/shortlinks.js', { + cwd: join(__dirname, '..', '..'), + }); + + proc.stdout?.on('data', (chunk) => core.info(`\n${chunk}`)); + proc.stderr?.on('data', (chunk) => core.warning(`\n${chunk}`)); + + return new Promise((resolve, reject) => + proc.on('exit', (code, signal) => { + core.info(`Script exited with code ${code}${signal ? `, with signal ${signal}` : ''}.`); + return code === 0 ? resolve(void 0) : reject(); + }) + ); +}; + +main().catch(() => process.exit(1)); diff --git a/.actions/tsconfig.json b/.actions/tsconfig.json new file mode 100644 index 00000000..487eb683 --- /dev/null +++ b/.actions/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@augu/tsconfig", + "compilerOptions": { + "moduleResolution": "node", + "typeRoots": ["./src/@types", "./node_modules/@types"], + "rootDir": "./src", + "types": ["node"], + "outDir": "./build", + "skipLibCheck": true, + "noEmit": true // @vercel/ncc will compile it, so TypeScript won't. + }, + "exclude": ["node_modules"], + "include": ["src/**/*.ts"] +} diff --git a/.actions/yarn.lock b/.actions/yarn.lock new file mode 100644 index 00000000..9b3dfae5 --- /dev/null +++ b/.actions/yarn.lock @@ -0,0 +1,173 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@actions/core@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.5.0.tgz#885b864700001a1b9a6fba247833a036e75ad9d3" + integrity sha512-eDOLH1Nq9zh+PJlYLqEMkS/jLQxhksPNmUGNBHfa4G+tQmnIhzpctxmchETtVGyBOvXgOVVpYuE40+eS4cUnwQ== + +"@actions/github@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.0.0.tgz#1754127976c50bd88b2e905f10d204d76d1472f8" + integrity sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ== + dependencies: + "@actions/http-client" "^1.0.11" + "@octokit/core" "^3.4.0" + "@octokit/plugin-paginate-rest" "^2.13.3" + "@octokit/plugin-rest-endpoint-methods" "^5.1.1" + +"@actions/http-client@^1.0.11": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0" + integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg== + dependencies: + tunnel "0.0.6" + +"@augu/tsconfig@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@augu/tsconfig/-/tsconfig-1.1.1.tgz#1c3a80f0734749a63f85ebf5b22889de9ab2e976" + integrity sha512-qTqAK8+kTefw3PTixTFUHYATvl5inkFKnz3ByaYXO6P0prq5csA2T4weyVSWzR7dKL7rto9kHXnnN/8bTuPTKg== + +"@augu/utils@1.5.3": + version "1.5.3" + resolved "https://registry.yarnpkg.com/@augu/utils/-/utils-1.5.3.tgz#eb82352e2690b0467ef690885e6496f0e7a12da9" + integrity sha512-Pyu+JoK7f7AUjZvffCjf6ZLEpwa09ig7WNOn/ozzZDGeWNad9PMj8EsYzVsKLRyP/SnvbLDvpRWGEObgcACtYg== + +"@octokit/auth-token@^2.4.4": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== + dependencies: + "@octokit/types" "^6.0.3" + +"@octokit/core@3.5.1", "@octokit/core@^3.4.0": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" + integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== + dependencies: + "@octokit/auth-token" "^2.4.4" + "@octokit/graphql" "^4.5.8" + "@octokit/request" "^5.6.0" + "@octokit/request-error" "^2.0.5" + "@octokit/types" "^6.0.3" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" + +"@octokit/endpoint@^6.0.1": + version "6.0.12" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" + integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== + dependencies: + "@octokit/types" "^6.0.3" + is-plain-object "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/graphql@^4.5.8": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" + integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== + dependencies: + "@octokit/request" "^5.6.0" + "@octokit/types" "^6.0.3" + universal-user-agent "^6.0.0" + +"@octokit/openapi-types@^10.2.2": + version "10.2.2" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.2.2.tgz#6c1c839d7d169feabaf1d2a69c79439c75d979cd" + integrity sha512-EVcXQ+ZrC04cg17AMg1ofocWMxHDn17cB66ZHgYc0eUwjFtxS0oBzkyw2VqIrHBwVgtfoYrq1WMQfQmMjUwthw== + +"@octokit/plugin-paginate-rest@^2.13.3": + version "2.16.3" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.3.tgz#6dbf74a12a53e04da6ca731d4c93f20c0b5c6fe9" + integrity sha512-kdc65UEsqze/9fCISq6BxLzeB9qf0vKvKojIfzgwf4tEF+Wy6c9dXnPFE6vgpoDFB1Z5Jek5WFVU6vL1w22+Iw== + dependencies: + "@octokit/types" "^6.28.1" + +"@octokit/plugin-rest-endpoint-methods@^5.1.1": + version "5.10.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.10.4.tgz#97e85eb7375e30b9bf193894670f9da205e79408" + integrity sha512-Dh+EAMCYR9RUHwQChH94Skl0lM8Fh99auT8ggck/xTzjJrwVzvsd0YH68oRPqp/HxICzmUjLfaQ9sy1o1sfIiA== + dependencies: + "@octokit/types" "^6.28.1" + deprecation "^2.3.1" + +"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" + integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== + dependencies: + "@octokit/types" "^6.0.3" + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.1.tgz#f97aff075c37ab1d427c49082fefeef0dba2d8ce" + integrity sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ== + dependencies: + "@octokit/endpoint" "^6.0.1" + "@octokit/request-error" "^2.1.0" + "@octokit/types" "^6.16.1" + is-plain-object "^5.0.0" + node-fetch "^2.6.1" + universal-user-agent "^6.0.0" + +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.28.1": + version "6.28.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.28.1.tgz#ab990d1fe952226055e81c7650480e6bacfb877c" + integrity sha512-XlxDoQLFO5JnFZgKVQTYTvXRsQFfr/GwDUU108NJ9R5yFPkA2qXhTJjYuul3vE4eLXP40FA2nysOu2zd6boE+w== + dependencies: + "@octokit/openapi-types" "^10.2.2" + +"@vercel/ncc@0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.31.1.tgz#9346c7e59326f5eeac75c0286e47df94c2d6d8f7" + integrity sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA== + +before-after-hook@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" + integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== + +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + +node-fetch@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.2.tgz#986996818b73785e47b1965cc34eb093a1d464d0" + integrity sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA== + +once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +tunnel@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + +typescript@4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" + integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== + +universal-user-agent@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" + integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/.github/workflows/ESLint.yml b/.github/workflows/ESLint.yml index b7114582..cc299f61 100644 --- a/.github/workflows/ESLint.yml +++ b/.github/workflows/ESLint.yml @@ -64,3 +64,8 @@ jobs: - name: Compiles the project to check for any build errors run: tsc --noEmit + + - name: Runs Jest and runs all unit tests + run: jest --config jest.config.ts --no-cache -i + env: + TEST_DISCORD_TOKEN: ${{ secrets.TEST_DISCORD_TOKEN }} diff --git a/.github/workflows/prod.yml b/.github/workflows/Production.yml similarity index 100% rename from .github/workflows/prod.yml rename to .github/workflows/Production.yml diff --git a/.github/workflows/Shortlinks.yml b/.github/workflows/Shortlinks.yml new file mode 100644 index 00000000..3b353e2b --- /dev/null +++ b/.github/workflows/Shortlinks.yml @@ -0,0 +1,19 @@ +name: ESLint Workflow +on: + schedule: + - cron: '0 0 * * *' +jobs: + shortlinks: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Use Node.js v16 + uses: actions/setup-node@v2 + with: + node-version: 16.x + + - name: Run the shortlinks script + working-directory: .actions/build + run: node shortlinks.js diff --git a/.github/workflows/edge.yml b/.github/workflows/Staging.yml similarity index 100% rename from .github/workflows/edge.yml rename to .github/workflows/Staging.yml diff --git a/.gitignore b/.gitignore index b17eae9e..21c5001f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules/ old_locales/ .husky/_/ build/ +!.actions/build/ # Jest coverage/ diff --git a/.prettierignore b/.prettierignore index c20b01f2..fa3ab480 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,6 +3,7 @@ .idea assets build +.actions/build/ .dockerignore .env @@ -14,3 +15,5 @@ package.json README.md renovate.json tsconfig.json +*.prisma +yarn.lock diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 7dc926f9..c59807b5 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -43,9 +43,12 @@ enum PunishmentType { model Automod { blacklistedWords String[] @map("blacklisted_words") + omitChannels String[] @map("omit_channels") + messageLinks Boolean @default(false) dehoisting Boolean @default(false) shortlinks Boolean @default(false) blacklist Boolean @default(false) + omitUsers String[] @map("omit_users") mentions Boolean @default(false) guildId String @map("guild_id") invites Boolean @default(false) @@ -82,7 +85,7 @@ model Cases { @@unique([guildId]) } -model Guild { +model Guilds { modlogChannelId String? @map("modlog_channel_id") mutedRoleId String? @map("muted_role_id") prefixes String[] @@ -118,7 +121,7 @@ model Punishments { @@unique([guildId, index]) } -model User { +model Users { prefixes String[] language String userId String @map("user_id") @@ -127,7 +130,7 @@ model User { @@unique([userId]) } -model Warning { +model Warnings { guildId String @map("guild_id") reason String? amount Int @@ -136,3 +139,13 @@ model Warning { @@map("warnings") @@unique([guildId, userId]) } + +model Customizibility { + webhook String? + logging Json + modlog Json + guildId String @map("guild_id") + + @@map("guild_customizibility") + @@unique([guildId]) +} diff --git a/scripts/migrations/v1.js b/scripts/migrations/v1.js deleted file mode 100644 index 22d4e5a9..00000000 --- a/scripts/migrations/v1.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright (c) 2019-2021 Nino - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -require('../../build/util/patches/RequirePatch'); - -const { - promises: { readFile }, - existsSync, -} = require('fs'); - -const { PrismaClient } = require('.prisma/client'); -const { withIndex } = require('~/build/util'); -const { join } = require('path'); - -const prisma = new PrismaClient(); - -const main = async () => { - console.log('migrations: v1: migrating...'); - - const MIGRATION_DATA_PATH = join(process.cwd(), '.nino', 'migration.json'); - if (!existsSync(MIGRATION_DATA_PATH)) { - console.warn('migrations: v1: run `yarn export:v1:db` before migrating...'); - await prisma.$disconnect(); - - process.exit(1); - } - - const contents = await readFile(MIGRATION_DATA_PATH, 'utf-8'); - const data = JSON.parse(contents); - - console.log( - `migrations: v1: running v1 -> v2 migrations that was executed at ${new Date( - Date.now() - data.ran_at - ).toString()} by ${data.blame}` - ); - - console.log(`migrations: v1: bulk insert ${data.data.automod.length} automod objects.`); - for (const [index, automod] of withIndex(data.data.automod)) { - console.log(`#${index}:`, automod); - - await prisma.automod.create({ - data: { - blacklistedWords: automod.blacklisted_words, - shortlinks: automod.shortlinks, - blacklist: automod.blacklist, - mentions: automod.mentions, - invites: automod.invites, - dehoisting: automod.dehoisting, - guildId: automod.guild_id, - spam: automod.spam, - raid: automod.raid, - }, - }); - } - - console.log('we are now done here!'); - await prisma.$disconnect(); - - process.exit(0); -}; - -main(); diff --git a/scripts/migrator/v0.js b/scripts/migrator/v0.js new file mode 100644 index 00000000..e69de29b diff --git a/scripts/migrator/v1.js b/scripts/migrator/v1.js new file mode 100644 index 00000000..e69de29b diff --git a/scripts/shortlinks.js b/scripts/shortlinks.js index fbab43ff..c0bc21b4 100644 --- a/scripts/shortlinks.js +++ b/scripts/shortlinks.js @@ -20,28 +20,21 @@ * SOFTWARE. */ -const { LoggerWithoutCallSite } = require('tslog'); const { calculateHRTime } = require('@augu/utils'); const { existsSync } = require('fs'); const { HttpClient } = require('@augu/orchid'); const { version } = require('../package.json'); const { join } = require('path'); + +/** @type {import('consola').default} */ +const consola = require('consola'); const fs = require('fs/promises'); const http = new HttpClient({ userAgent: `Nino/DiscordBot (https://github.com/NinoDiscord/Nino, v${version})`, }); -const logger = new LoggerWithoutCallSite({ - displayFunctionName: true, - exposeErrorCodeFrame: true, - displayInstanceName: true, - displayFilePath: false, - dateTimePattern: '[ day-month-year / hour:minute:second ]', - instanceName: 'script: shortlinks', - name: 'scripts', -}); - +const logger = consola.withScope('nino:scripts:shortlinks'); const otherUrls = [ 'shorte.st', 'adf.ly', diff --git a/scripts/update-punishments.js b/scripts/update-punishments.js deleted file mode 100644 index 97473493..00000000 --- a/scripts/update-punishments.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (c) 2019-2021 Nino - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -const { createConnection } = require('typeorm'); -const { - default: PunishmentsEntity, -} = require('../build/entities/PunishmentsEntity'); - -async function main() { - console.log( - `[scripts:update-punishments | ${new Date().toLocaleTimeString()}] Updating punishments...` - ); - const connection = await createConnection(); - - // Retrieve all punishments - const repository = connection.getRepository(PunishmentsEntity); - const punishments = await repository.find({}); - const traversedGuilds = []; - let i = 0; - - await repository.delete({}); - - // Update punishments - console.log( - `[scripts:update-punishments | ${new Date().toLocaleTimeString()}] Found ${ - punishments.length - } punishments to update` - ); - for (const punishment of punishments) { - console.log( - `idx: ${i} | guild entry: ${ - traversedGuilds.find((c) => c.guild === punishment.guildID) !== - undefined - }` - ); - - if ( - traversedGuilds.find((c) => c.guild === punishment.guildID) !== undefined - ) { - const f = traversedGuilds.find((c) => c.guild === punishment.guildID); - const id = traversedGuilds.findIndex( - (c) => c.guild === punishment.guildID - ); - const entity = new PunishmentsEntity(); - - entity.warnings = punishment.warnings; - entity.guildID = punishment.guildID; - entity.index = f.index += 1; - entity.soft = punishment.soft; - entity.time = punishment.time; - entity.type = punishment.type; - entity.days = punishment.days; - - traversedGuilds[id] = { - guild: punishment.guildID, - index: (f.index += 1), - }; - await repository.save(entity); - } else { - const entity = new PunishmentsEntity(); - entity.warnings = punishment.warnings; - entity.guildID = punishment.guildID; - entity.index = 1; - entity.soft = punishment.soft; - entity.time = punishment.time; - entity.type = punishment.type; - entity.days = punishment.days; - - traversedGuilds.push({ guild: punishment.guildID, index: 1 }); - await repository.save(entity); - } - } -} - -main(); diff --git a/scripts/util/getCaseType.js b/scripts/util/getCaseType.js deleted file mode 100644 index 99188470..00000000 --- a/scripts/util/getCaseType.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2019-2021 Nino - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -const { PunishmentType } = require('../../build/entities/PunishmentsEntity'); - -/** - * Determines the type from v0.x to v1.x - * @param {'warning remove' | 'warning add' | 'unmute' | 'kick' | 'mute' | 'ban'} type The type to serialize - * @returns {string} The punishment type - */ -module.exports = (type) => { - switch (type) { - case 'warning remove': - return PunishmentType.WarningRemoved; - - case 'warning add': - return PunishmentType.WarningAdded; - - case 'unmute': - return PunishmentType.Unmute; - - case 'kick': - return PunishmentType.Kick; - - case 'mute': - return PunishmentType.Mute; - - case 'ban': - return PunishmentType.Ban; - } -}; diff --git a/scripts/util/getRepositories.js b/scripts/util/getRepositories.js deleted file mode 100644 index 1c7b66dd..00000000 --- a/scripts/util/getRepositories.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2019-2021 Nino - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -const { - default: PunishmentsEntity, -} = require('../../build/entities/PunishmentsEntity'); -const { - default: AutomodEntity, -} = require('../../build/entities/AutomodEntity'); -const { default: CaseEntity } = require('../../build/entities/CaseEntity'); -const { default: GuildEntity } = require('../../build/entities/GuildEntity'); -const { - default: WarningsEntity, -} = require('../../build/entities/WarningsEntity'); -const { - default: LoggingEntity, -} = require('../../build/entities/LoggingEntity'); -const { default: UserEntity } = require('../../build/entities/UserEntity'); - -/** - * Returns the repositories from the responding `connection`. - * @param {import('typeorm').Connection} connection The connection established - */ -module.exports = (connection) => ({ - punishments: connection.getRepository(PunishmentsEntity), - warnings: connection.getRepository(WarningsEntity), - logging: connection.getRepository(LoggingEntity), - automod: connection.getRepository(AutomodEntity), - guilds: connection.getRepository(GuildEntity), - cases: connection.getRepository(CaseEntity), - users: connection.getRepository(UserEntity), -});