Merge pull request #1033 from akv-platform/apirate

Turn the action into stateful
This commit is contained in:
Sergey Dolin 2023-07-06 08:00:12 +02:00 committed by GitHub
commit 465330b7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 58128 additions and 5115 deletions

20
.licenses/npm/@actions/cache.dep.yml generated Normal file
View File

@ -0,0 +1,20 @@
---
name: "@actions/cache"
version: 3.2.1
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

20
.licenses/npm/@actions/exec.dep.yml generated Normal file
View File

@ -0,0 +1,20 @@
---
name: "@actions/exec"
version: 1.1.1
type: npm
summary: Actions exec lib
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

20
.licenses/npm/@actions/glob.dep.yml generated Normal file
View File

@ -0,0 +1,20 @@
---
name: "@actions/glob"
version: 0.1.2
type: npm
summary: Actions glob lib
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

View File

@ -1,6 +1,6 @@
--- ---
name: "@actions/http-client" name: "@actions/http-client"
version: 2.0.1 version: 2.1.0
type: npm type: npm
summary: Actions Http Client summary: Actions Http Client
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client homepage: https://github.com/actions/toolkit/tree/main/packages/http-client

20
.licenses/npm/@actions/io.dep.yml generated Normal file
View File

@ -0,0 +1,20 @@
---
name: "@actions/io"
version: 1.1.3
type: npm
summary: Actions io lib
homepage: https://github.com/actions/toolkit/tree/main/packages/io
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

View File

@ -0,0 +1,32 @@
---
name: "@azure/abort-controller"
version: 1.1.0
type: npm
summary: Microsoft Azure SDK for JavaScript - Aborter
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

33
.licenses/npm/@azure/core-auth.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: "@azure/core-auth"
version: 1.4.0
type: npm
summary: Provides low-level interfaces and helper methods for authentication in Azure
SDK
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-auth/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

33
.licenses/npm/@azure/core-http.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: "@azure/core-http"
version: 3.0.2
type: npm
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
libraries generated using AutoRest
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-http/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

33
.licenses/npm/@azure/core-lro.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: "@azure/core-lro"
version: 2.5.3
type: npm
summary: Isomorphic client library for supporting long-running operations in node.js
and browser.
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

32
.licenses/npm/@azure/core-paging.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: "@azure/core-paging"
version: 1.5.0
type: npm
summary: Core types for paging async iterable iterators
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

View File

@ -0,0 +1,32 @@
---
name: "@azure/core-tracing"
version: 1.0.0-preview.13
type: npm
summary: Provides low-level interfaces and helper methods for tracing in Azure SDK
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-tracing/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

32
.licenses/npm/@azure/core-util.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: "@azure/core-util"
version: 1.3.2
type: npm
summary: Core library for shared utility methods
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-util/
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

32
.licenses/npm/@azure/logger.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: "@azure/logger"
version: 1.0.4
type: npm
summary: Microsoft Azure SDK for JavaScript - Logger
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

33
.licenses/npm/@azure/ms-rest-js.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: "@azure/ms-rest-js"
version: 2.6.6
type: npm
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
libraries generated using AutoRest
homepage: https://github.com/Azure/ms-rest-js
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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
notices: []

View File

@ -0,0 +1,32 @@
---
name: "@azure/storage-blob"
version: 12.14.0
type: npm
summary: Microsoft Azure Storage SDK for JavaScript - Blob
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2020 Microsoft
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.
notices: []

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/auth-token" name: "@octokit/auth-token"
version: 3.0.3 version: 3.0.4
type: npm type: npm
summary: GitHub API token authentication for browsers and Node.js summary: GitHub API token authentication for browsers and Node.js
homepage: homepage:

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/core" name: "@octokit/core"
version: 4.2.0 version: 4.2.4
type: npm type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs summary: Extendable client for GitHub's REST & GraphQL APIs
homepage: homepage:

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/endpoint" name: "@octokit/endpoint"
version: 7.0.5 version: 7.0.6
type: npm type: npm
summary: Turns REST API endpoints into generic request options summary: Turns REST API endpoints into generic request options
homepage: homepage:

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/graphql" name: "@octokit/graphql"
version: 5.0.5 version: 5.0.6
type: npm type: npm
summary: GitHub GraphQL API client for browsers and Node summary: GitHub GraphQL API client for browsers and Node
homepage: homepage:

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/openapi-types" name: "@octokit/openapi-types"
version: 16.0.0 version: 18.0.0
type: npm type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage: homepage:

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/plugin-retry" name: "@octokit/plugin-retry"
version: 4.1.3 version: 4.1.6
type: npm type: npm
summary: Automatic retry plugin for octokit summary: Automatic retry plugin for octokit
homepage: homepage:

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/request" name: "@octokit/request"
version: 6.2.3 version: 6.2.8
type: npm type: npm
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
and Node and Node

View File

@ -1,6 +1,6 @@
--- ---
name: "@octokit/types" name: "@octokit/types"
version: 9.0.0 version: 9.3.2
type: npm type: npm
summary: Shared TypeScript definitions for Octokit projects summary: Shared TypeScript definitions for Octokit projects
homepage: homepage:

223
.licenses/npm/@opentelemetry/api.dep.yml generated Normal file
View File

@ -0,0 +1,223 @@
---
name: "@opentelemetry/api"
version: 1.4.1
type: npm
summary: Public API for OpenTelemetry
homepage: https://github.com/open-telemetry/opentelemetry-js/tree/main/api
license: apache-2.0
licenses:
- sources: LICENSE
text: |2
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 [yyyy] [name of copyright owner]
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.
- sources: README.md
text: |-
Apache 2.0 - See [LICENSE][license-url] for more information.
[opentelemetry-js]: https://github.com/open-telemetry/opentelemetry-js
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md
notices: []

32
.licenses/npm/@types/node-fetch.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: "@types/node-fetch"
version: 2.6.4
type: npm
summary: TypeScript definitions for node-fetch
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation.
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
notices: []

32
.licenses/npm/@types/node.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: "@types/node"
version: 18.16.18
type: npm
summary: TypeScript definitions for Node.js
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation.
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
notices: []

32
.licenses/npm/@types/tunnel.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: "@types/tunnel"
version: 0.0.3
type: npm
summary: TypeScript definitions for tunnel
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tunnel
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation.
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
notices: []

32
.licenses/npm/abort-controller.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: abort-controller
version: 3.0.0
type: npm
summary: An implementation of WHATWG AbortController interface.
homepage: https://github.com/mysticatea/abort-controller#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2017 Toru Nagashima
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.
notices: []

34
.licenses/npm/asynckit.dep.yml generated Normal file
View File

@ -0,0 +1,34 @@
---
name: asynckit
version: 0.4.0
type: npm
summary: Minimal async jobs utility library, with streams support
homepage: https://github.com/alexindigo/asynckit#readme
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2016 Alex Indigo
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.
- sources: README.md
text: AsyncKit is licensed under the MIT license.
notices: []

55
.licenses/npm/balanced-match.dep.yml generated Normal file
View File

@ -0,0 +1,55 @@
---
name: balanced-match
version: 1.0.2
type: npm
summary: Match balanced character pairs, like "{" and "}"
homepage: https://github.com/juliangruber/balanced-match
license: mit
licenses:
- sources: LICENSE.md
text: |
(MIT)
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
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.
- sources: README.md
text: |-
(MIT)
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
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.
notices: []

55
.licenses/npm/brace-expansion.dep.yml generated Normal file
View File

@ -0,0 +1,55 @@
---
name: brace-expansion
version: 1.1.11
type: npm
summary: Brace expansion as known from sh/bash
homepage: https://github.com/juliangruber/brace-expansion
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
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.
- sources: README.md
text: |-
(MIT)
Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
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.
notices: []

32
.licenses/npm/combined-stream.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: combined-stream
version: 1.0.8
type: npm
summary: A stream that emits multiple other streams one after another.
homepage: https://github.com/felixge/node-combined-stream
license: mit
licenses:
- sources: License
text: |
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
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.
- sources: Readme.md
text: combined-stream is licensed under the MIT license.
notices: []

31
.licenses/npm/concat-map.dep.yml generated Normal file
View File

@ -0,0 +1,31 @@
---
name: concat-map
version: 0.0.1
type: npm
summary: concatenative mapdashery
homepage:
license: other
licenses:
- sources: LICENSE
text: |
This software is released under the 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.
- sources: README.markdown
text: MIT
notices: []

32
.licenses/npm/delayed-stream.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: delayed-stream
version: 1.0.0
type: npm
summary: Buffers events from a stream until you are ready to handle them.
homepage: https://github.com/felixge/node-delayed-stream
license: mit
licenses:
- sources: License
text: |
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
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.
- sources: Readme.md
text: delayed-stream is licensed under the MIT license.
notices: []

34
.licenses/npm/event-target-shim.dep.yml generated Normal file
View File

@ -0,0 +1,34 @@
---
name: event-target-shim
version: 5.0.1
type: npm
summary: An implementation of WHATWG EventTarget interface.
homepage: https://github.com/mysticatea/event-target-shim
license: mit
licenses:
- sources: LICENSE
text: |+
The MIT License (MIT)
Copyright (c) 2015 Toru Nagashima
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.
notices: []
...

38
.licenses/npm/events.dep.yml generated Normal file
View File

@ -0,0 +1,38 @@
---
name: events
version: 3.3.0
type: npm
summary: Node's event emitter for all engines.
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT
Copyright Joyent, Inc. and other Node 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.
- sources: Readme.md
text: |-
[MIT](./LICENSE)
[node.js docs]: https://nodejs.org/dist/v11.13.0/docs/api/events.html
notices: []

33
.licenses/npm/form-data-2.5.1.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: form-data
version: 2.5.1
type: npm
summary: A library to create readable "multipart/form-data" streams. Can be used to
submit forms and file uploads to other web applications.
homepage:
license: mit
licenses:
- sources: License
text: |
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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.
- sources: README.md
text: Form-Data is released under the [MIT](License) license.
notices: []

33
.licenses/npm/form-data-3.0.1.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: form-data
version: 3.0.1
type: npm
summary: A library to create readable "multipart/form-data" streams. Can be used to
submit forms and file uploads to other web applications.
homepage:
license: mit
licenses:
- sources: License
text: |
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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.
- sources: Readme.md
text: Form-Data is released under the [MIT](License) license.
notices: []

33
.licenses/npm/form-data-4.0.0.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: form-data
version: 4.0.0
type: npm
summary: A library to create readable "multipart/form-data" streams. Can be used to
submit forms and file uploads to other web applications.
homepage:
license: mit
licenses:
- sources: License
text: |
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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.
- sources: Readme.md
text: Form-Data is released under the [MIT](License) license.
notices: []

34
.licenses/npm/ip-regex.dep.yml generated Normal file
View File

@ -0,0 +1,34 @@
---
name: ip-regex
version: 2.1.0
type: npm
summary: Regular expression for matching IP addresses (IPv4 & IPv6)
homepage:
license: mit
licenses:
- sources: license
text: |
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.
- sources: readme.md
text: MIT © [Sindre Sorhus](https://sindresorhus.com)
notices: []

34
.licenses/npm/mime-db.dep.yml generated Normal file
View File

@ -0,0 +1,34 @@
---
name: mime-db
version: 1.52.0
type: npm
summary: Media Type Database
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
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.
notices: []

47
.licenses/npm/mime-types.dep.yml generated Normal file
View File

@ -0,0 +1,47 @@
---
name: mime-types
version: 2.1.35
type: npm
summary: The ultimate javascript content-type utility.
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
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.
- sources: README.md
text: |-
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
[node-version-image]: https://badgen.net/npm/node/mime-types
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
[npm-url]: https://npmjs.org/package/mime-types
[npm-version-image]: https://badgen.net/npm/v/mime-types
notices: []

26
.licenses/npm/minimatch.dep.yml generated Normal file
View File

@ -0,0 +1,26 @@
---
name: minimatch
version: 3.1.2
type: npm
summary: a glob matcher in javascript
homepage:
license: isc
licenses:
- sources: LICENSE
text: |
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.
notices: []

View File

@ -1,6 +1,6 @@
--- ---
name: node-fetch name: node-fetch
version: 2.6.9 version: 2.6.11
type: npm type: npm
summary: A light-weight module that brings window.fetch to node.js summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch homepage: https://github.com/bitinn/node-fetch

33
.licenses/npm/process.dep.yml generated Normal file
View File

@ -0,0 +1,33 @@
---
name: process
version: 0.11.10
type: npm
summary: process information for node.js and browsers
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
(The MIT License)
Copyright (c) 2013 Roman Shtylman <shtylman@gmail.com>
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.
notices: []

43
.licenses/npm/psl.dep.yml generated Normal file
View File

@ -0,0 +1,43 @@
---
name: psl
version: 1.9.0
type: npm
summary: Domain name parser based on the Public Suffix List
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2017 Lupo Montero lupomontero@gmail.com
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.
- sources: README.md
text: |-
The MIT License (MIT)
Copyright (c) 2017 Lupo Montero <lupomontero@gmail.com>
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.
notices: []

34
.licenses/npm/punycode.dep.yml generated Normal file
View File

@ -0,0 +1,34 @@
---
name: punycode
version: 2.3.0
type: npm
summary: A robust Punycode converter that fully complies to RFC 3492 and RFC 5891,
and works on nearly all JavaScript platforms.
homepage: https://mths.be/punycode
license: mit
licenses:
- sources: LICENSE-MIT.txt
text: |
Copyright Mathias Bynens <https://mathiasbynens.be/>
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.
- sources: README.md
text: Punycode.js is available under the [MIT](https://mths.be/mit) license.
notices: []

52
.licenses/npm/sax.dep.yml generated Normal file
View File

@ -0,0 +1,52 @@
---
name: sax
version: 1.2.4
type: npm
summary: An evented streaming XML parser in JavaScript
homepage:
license: isc
licenses:
- sources: LICENSE
text: |
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.
====
`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
License, as follows:
Copyright Mathias Bynens <https://mathiasbynens.be/>
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.
notices: []

View File

@ -1,9 +1,9 @@
--- ---
name: semver name: semver
version: 7.3.8 version: 6.3.0
type: npm type: npm
summary: The semantic version parser used by npm. summary: The semantic version parser used by npm.
homepage: homepage:
license: isc license: isc
licenses: licenses:
- sources: LICENSE - sources: LICENSE

26
.licenses/npm/semver-7.5.3.dep.yml generated Normal file
View File

@ -0,0 +1,26 @@
---
name: semver
version: 7.5.3
type: npm
summary: The semantic version parser used by npm.
homepage:
license: isc
licenses:
- sources: LICENSE
text: |
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.
notices: []

23
.licenses/npm/tough-cookie.dep.yml generated Normal file
View File

@ -0,0 +1,23 @@
---
name: tough-cookie
version: 3.0.1
type: npm
summary: RFC6265 Cookies and Cookie Jar for node.js
homepage: https://github.com/salesforce/tough-cookie
license: bsd-3-clause
licenses:
- sources: LICENSE
text: |
Copyright (c) 2015, Salesforce.com, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
notices: []

23
.licenses/npm/tslib-1.14.1.dep.yml generated Normal file
View File

@ -0,0 +1,23 @@
---
name: tslib
version: 1.14.1
type: npm
summary: Runtime library for TypeScript helper functions
homepage: https://www.typescriptlang.org/
license: isc
licenses:
- sources: LICENSE.txt
text: |-
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
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.
notices: []

23
.licenses/npm/tslib-2.6.0.dep.yml generated Normal file
View File

@ -0,0 +1,23 @@
---
name: tslib
version: 2.6.0
type: npm
summary: Runtime library for TypeScript helper functions
homepage: https://www.typescriptlang.org/
license: isc
licenses:
- sources: LICENSE.txt
text: |-
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
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.
notices: []

39
.licenses/npm/uuid-3.4.0.dep.yml generated Normal file
View File

@ -0,0 +1,39 @@
---
name: uuid
version: 3.4.0
type: npm
summary: RFC4122 (v1, v4, and v5) UUIDs
homepage:
license: mit
licenses:
- sources: LICENSE.md
text: |
The MIT License (MIT)
Copyright (c) 2010-2016 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices:
- sources: AUTHORS
text: |-
Robert Kieffer <robert@broofa.com>
Christoph Tavan <dev@tavan.de>
AJ ONeal <coolaj86@gmail.com>
Vincent Voyer <vincent@zeroload.net>
Roman Shtylman <shtylman@gmail.com>

View File

@ -3,7 +3,7 @@ name: uuid
version: 8.3.2 version: 8.3.2
type: npm type: npm
summary: RFC4122 (v1, v4, and v5) UUIDs summary: RFC4122 (v1, v4, and v5) UUIDs
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

30
.licenses/npm/xml2js.dep.yml generated Normal file
View File

@ -0,0 +1,30 @@
---
name: xml2js
version: 0.5.0
type: npm
summary: Simple XML to JavaScript object converter.
homepage: https://github.com/Leonidas-from-XIV/node-xml2js
license: mit
licenses:
- sources: LICENSE
text: |
Copyright 2010, 2011, 2012, 2013. All rights reserved.
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.
notices: []

32
.licenses/npm/xmlbuilder.dep.yml generated Normal file
View File

@ -0,0 +1,32 @@
---
name: xmlbuilder
version: 11.0.1
type: npm
summary: An XML builder for node.js
homepage: http://github.com/oozcitak/xmlbuilder-js
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2013 Ozgur Ozcitak
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.
notices: []

View File

@ -26,6 +26,16 @@ permissions:
You can find more information about the required permissions under the corresponding options that you wish to use. You can find more information about the required permissions under the corresponding options that you wish to use.
## Statefulness
If the action ends because of [operations-per-run](#operations-per-run) then the next run will start from the first
unprocessed issue skipping the issues proceeded during the previous run(s). The state is reset when all the issues are
proceeded. This should be considered for scheduling workflow runs.
The saved state lifetime is the same as the
[actions cache](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy)
configured for the repo.
## All options ## All options
### List of input options ### List of input options

View File

@ -4,6 +4,7 @@ import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-option
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {StateMock} from './classes/state-mock';
let issuesProcessorBuilder: IssuesProcessorBuilder; let issuesProcessorBuilder: IssuesProcessorBuilder;
let issuesProcessor: IssuesProcessorMock; let issuesProcessor: IssuesProcessorMock;
@ -1102,6 +1103,7 @@ class IssuesProcessorBuilder {
issue.title ?? 'dummy-title', issue.title ?? 'dummy-title',
issue.updated_at ?? new Date().toDateString(), issue.updated_at ?? new Date().toDateString(),
issue.created_at ?? new Date().toDateString(), issue.created_at ?? new Date().toDateString(),
false,
!!issue.pull_request, !!issue.pull_request,
issue.labels ? issue.labels.map(label => label.name || '') : [] issue.labels ? issue.labels.map(label => label.name || '') : []
) )
@ -1139,6 +1141,7 @@ class IssuesProcessorBuilder {
build(): IssuesProcessorMock { build(): IssuesProcessorMock {
return new IssuesProcessorMock( return new IssuesProcessorMock(
this._options, this._options,
new StateMock(),
async p => (p === 1 ? this._issues : []), async p => (p === 1 ? this._issues : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

View File

@ -3,6 +3,7 @@ import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-option
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
interface ITestData { interface ITestData {
id: number; id: number;
@ -35,6 +36,7 @@ describe('assignees options', (): void => {
'My first issue', 'My first issue',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
isPullRequest, isPullRequest,
undefined, undefined,
undefined, undefined,
@ -48,6 +50,7 @@ describe('assignees options', (): void => {
const setProcessor = () => { const setProcessor = () => {
processor = new IssuesProcessorMock( processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? testIssueList : []), async p => (p === 1 ? testIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

View File

@ -3,10 +3,12 @@ import {IssuesProcessor} from '../../src/classes/issues-processor';
import {IComment} from '../../src/interfaces/comment'; import {IComment} from '../../src/interfaces/comment';
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options'; import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
import {IPullRequest} from '../../src/interfaces/pull-request'; import {IPullRequest} from '../../src/interfaces/pull-request';
import {IState} from '../../src/interfaces/state/state';
export class IssuesProcessorMock extends IssuesProcessor { export class IssuesProcessorMock extends IssuesProcessor {
constructor( constructor(
options: IIssuesProcessorOptions, options: IIssuesProcessorOptions,
state: IState,
getIssues?: (page: number) => Promise<Issue[]>, getIssues?: (page: number) => Promise<Issue[]>,
listIssueComments?: ( listIssueComments?: (
issue: Issue, issue: Issue,
@ -18,7 +20,7 @@ export class IssuesProcessorMock extends IssuesProcessor {
) => Promise<string | undefined>, ) => Promise<string | undefined>,
getPullRequest?: (issue: Issue) => Promise<IPullRequest | undefined | void> getPullRequest?: (issue: Issue) => Promise<IPullRequest | undefined | void>
) { ) {
super(options); super(options, state);
if (getIssues) { if (getIssues) {
this.getIssues = getIssues; this.getIssues = getIssues;

View File

@ -0,0 +1,24 @@
import {IState} from '../../src/interfaces/state/state';
import {IIssue} from '../../src/interfaces/issue';
export class StateMock implements IState {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
addIssueToProcessed(issue: IIssue) {}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
isIssueProcessed(issue: IIssue) {
return false;
}
persist(): Promise<void> {
return Promise.resolve(undefined);
}
restore(): Promise<void> {
return Promise.resolve(undefined);
}
reset() {}
}
export const alwaysFalseStateMock = new StateMock();

View File

@ -5,6 +5,7 @@ import {IPullRequest} from '../src/interfaces/pull-request';
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
let issuesProcessorBuilder: IssuesProcessorBuilder; let issuesProcessorBuilder: IssuesProcessorBuilder;
let issuesProcessor: IssuesProcessorMock; let issuesProcessor: IssuesProcessorMock;
@ -45,6 +46,7 @@ describe('exempt-draft-pr option', (): void => {
issuesProcessor = issuesProcessorBuilder issuesProcessor = issuesProcessorBuilder
.toStalePrs([ .toStalePrs([
{ {
draft: true,
number: 20 number: 20
} }
]) ])
@ -84,6 +86,7 @@ class IssuesProcessorBuilder {
issue.title ?? 'dummy-title', issue.title ?? 'dummy-title',
issue.updated_at ?? new Date().toDateString(), issue.updated_at ?? new Date().toDateString(),
issue.created_at ?? new Date().toDateString(), issue.created_at ?? new Date().toDateString(),
!!issue.draft,
!!issue.pull_request, !!issue.pull_request,
issue.labels ? issue.labels.map(label => label.name || '') : [] issue.labels ? issue.labels.map(label => label.name || '') : []
) )
@ -122,6 +125,7 @@ class IssuesProcessorBuilder {
build(): IssuesProcessorMock { build(): IssuesProcessorMock {
return new IssuesProcessorMock( return new IssuesProcessorMock(
this._options, this._options,
alwaysFalseStateMock,
async p => (p === 1 ? this._issues : []), async p => (p === 1 ? this._issues : []),
async () => [], async () => [],
async () => new Date().toDateString(), async () => new Date().toDateString(),

View File

@ -9,6 +9,7 @@ export function generateIIssue(
labels: [], labels: [],
created_at: new Date().toISOString(), created_at: new Date().toISOString(),
updated_at: new Date().toISOString(), updated_at: new Date().toISOString(),
draft: false,
number: Math.round(Math.random() * 5000), number: Math.round(Math.random() * 5000),
pull_request: null, pull_request: null,
title: 'dummy-title', title: 'dummy-title',

View File

@ -9,6 +9,7 @@ export function generateIssue(
title: string, title: string,
updatedAt: IsoDateString, updatedAt: IsoDateString,
createdAt: IsoDateString = updatedAt, createdAt: IsoDateString = updatedAt,
draft = false,
isPullRequest = false, isPullRequest = false,
labels: string[] = [], labels: string[] = [],
isClosed = false, isClosed = false,
@ -24,6 +25,7 @@ export function generateIssue(
title, title,
created_at: createdAt, created_at: createdAt,
updated_at: updatedAt, updated_at: updatedAt,
draft: draft,
pull_request: isPullRequest ? {} : null, pull_request: isPullRequest ? {} : null,
state: isClosed ? 'closed' : 'open', state: isClosed ? 'closed' : 'open',
locked: isLocked, locked: isLocked,

View File

@ -5,6 +5,7 @@ import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-option
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
test('processing an issue with no label will make it stale and close it, if it is old enough only if days-before-close is set to 0', async () => { test('processing an issue with no label will make it stale and close it, if it is old enough only if days-before-close is set to 0', async () => {
const opts: IIssuesProcessorOptions = { const opts: IIssuesProcessorOptions = {
@ -16,6 +17,7 @@ test('processing an issue with no label will make it stale and close it, if it i
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -47,6 +49,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -78,6 +81,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -109,6 +113,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -140,6 +145,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -171,6 +177,7 @@ test('processing an issue with no label and a start date as ISO 8601 being befor
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -202,6 +209,7 @@ test('processing an issue with no label and a start date as ISO 8601 being after
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -233,6 +241,7 @@ test('processing an issue with no label and a start date as RFC 2822 being befor
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -264,6 +273,7 @@ test('processing an issue with no label and a start date as RFC 2822 being after
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -287,6 +297,7 @@ test('processing an issue with no label will make it stale and close it, if it i
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -311,6 +322,7 @@ test('processing an issue with no label will make it stale and not close it, if
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -333,6 +345,7 @@ test('processing an issue with no label will make it stale and not close it if d
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -356,6 +369,7 @@ test('processing an issue with no label will make it stale and not close it if d
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -379,6 +393,7 @@ test('processing an issue with no label will not make it stale if days-before-st
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -403,6 +418,7 @@ test('processing an issue with no label will not make it stale if days-before-st
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -430,6 +446,7 @@ test('processing an issue with no label will make it stale but not close it', as
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -455,11 +472,13 @@ test('processing a stale issue will close it', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -485,11 +504,13 @@ test('processing a stale issue containing a space in the label will close it', a
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['state: stale'] ['state: stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -515,11 +536,13 @@ test('processing a stale issue containing a slash in the label will close it', a
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['lifecycle/stale'] ['lifecycle/stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -546,11 +569,13 @@ test('processing a stale issue will close it when days-before-issue-stale overri
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -575,12 +600,14 @@ test('processing a stale PR will close it', async () => {
'A stale PR that should be closed', 'A stale PR that should be closed',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -606,12 +633,14 @@ test('processing a stale PR will close it when days-before-pr-stale override day
'A stale PR that should be closed', 'A stale PR that should be closed',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -638,11 +667,13 @@ test('processing a stale issue will close it even if configured not to mark as s
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -670,11 +701,13 @@ test('processing a stale issue will close it even if configured not to mark as s
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -700,12 +733,14 @@ test('processing a stale PR will close it even if configured not to mark as stal
'An issue with no label', 'An issue with no label',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -732,12 +767,14 @@ test('processing a stale PR will close it even if configured not to mark as stal
'An issue with no label', 'An issue with no label',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -759,12 +796,14 @@ test('closed issues will not be marked stale', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
[], [],
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [] async () => []
); );
@ -785,12 +824,14 @@ test('stale closed issues will not be closed', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'], ['Stale'],
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -811,6 +852,7 @@ test('closed prs will not be marked stale', async () => {
'A closed PR that will not be marked', 'A closed PR that will not be marked',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
[], [],
true true
@ -818,6 +860,7 @@ test('closed prs will not be marked stale', async () => {
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -838,6 +881,7 @@ test('stale closed prs will not be closed', async () => {
'A stale closed PR that will not be closed again', 'A stale closed PR that will not be closed again',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'], ['Stale'],
true true
@ -845,6 +889,7 @@ test('stale closed prs will not be closed', async () => {
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -866,13 +911,16 @@ test('locked issues will not be marked stale', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
[], [],
false, false,
true true
) )
]; ];
const processor = new IssuesProcessorMock(DefaultProcessorOptions, async p => const processor = new IssuesProcessorMock(
p === 1 ? TestIssueList : [] DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : [])
); );
// process our fake issue list // process our fake issue list
@ -891,6 +939,7 @@ test('stale locked issues will not be closed', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'], ['Stale'],
false, false,
true true
@ -898,6 +947,7 @@ test('stale locked issues will not be closed', async () => {
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -918,14 +968,17 @@ test('locked prs will not be marked stale', async () => {
'A locked PR that will not be marked stale', 'A locked PR that will not be marked stale',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
[], [],
false, false,
true true
) )
]; ];
const processor = new IssuesProcessorMock(DefaultProcessorOptions, async p => const processor = new IssuesProcessorMock(
p === 1 ? TestIssueList : [] DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : [])
); );
// process our fake issue list // process our fake issue list
@ -943,6 +996,7 @@ test('stale locked prs will not be closed', async () => {
'A stale locked PR that will not be closed', 'A stale locked PR that will not be closed',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'], ['Stale'],
false, false,
@ -951,6 +1005,7 @@ test('stale locked prs will not be closed', async () => {
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -975,11 +1030,13 @@ test('exempt issue labels will not be marked stale', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Exempt'] ['Exempt']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1004,11 +1061,13 @@ test('exempt issue labels will not be marked stale (multi issue label with space
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Cool'] ['Cool']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1032,11 +1091,13 @@ test('exempt issue labels will not be marked stale (multi issue label)', async (
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Cool'] ['Cool']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1061,6 +1122,7 @@ test('exempt pr labels will not be marked stale', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Cool'] ['Cool']
), ),
generateIssue( generateIssue(
@ -1069,6 +1131,7 @@ test('exempt pr labels will not be marked stale', async () => {
'My first PR', 'My first PR',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Cool'] ['Cool']
), ),
@ -1078,11 +1141,13 @@ test('exempt pr labels will not be marked stale', async () => {
'Another issue', 'Another issue',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
false false
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1105,6 +1170,7 @@ test('stale issues should not be closed if days is set to -1', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
), ),
generateIssue( generateIssue(
@ -1113,6 +1179,7 @@ test('stale issues should not be closed if days is set to -1', async () => {
'My first PR', 'My first PR',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
true, true,
['Stale'] ['Stale']
), ),
@ -1123,11 +1190,13 @@ test('stale issues should not be closed if days is set to -1', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1150,11 +1219,13 @@ test('stale label should be removed if a comment was added to a stale issue', as
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [ async () => [
{ {
@ -1191,11 +1262,13 @@ test('when the option "labelsToAddWhenUnstale" is set, the labels should be adde
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [ async () => [
{ {
@ -1235,11 +1308,13 @@ test('when the option "labelsToRemoveWhenStale" is set, the labels should be rem
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale', 'test'] ['Stale', 'test']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [ async () => [
{ {
@ -1273,11 +1348,13 @@ test('stale label should not be removed if a comment was added by the bot (and t
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [ async () => [
{ {
@ -1313,11 +1390,13 @@ test('stale label containing a space should be removed if a comment was added to
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
['stat: stale'] ['stat: stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [{user: {login: 'notme', type: 'User'}, body: 'Body'}], // return a fake comment to indicate there was an update async () => [{user: {login: 'notme', type: 'User'}, body: 'Body'}], // return a fake comment to indicate there was an update
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1349,6 +1428,7 @@ test('stale issues should not be closed until after the closed number of days',
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1376,11 +1456,13 @@ test('stale issues should be closed if the closed nubmer of days (additive) is a
lastUpdate.toString(), lastUpdate.toString(),
lastUpdate.toString(), lastUpdate.toString(),
false, false,
false,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1412,6 +1494,7 @@ test('stale issues should not be closed until after the closed number of days (l
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1444,6 +1527,7 @@ test('skips stale message on issues when stale-issue-message is empty', async ()
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1488,6 +1572,7 @@ test('send stale message on issues when stale-issue-message is not empty', async
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1527,11 +1612,13 @@ test('skips stale message on prs when stale-pr-message is empty', async () => {
'An issue that should be marked stale but not closed', 'An issue that should be marked stale but not closed',
lastUpdate.toString(), lastUpdate.toString(),
lastUpdate.toString(), lastUpdate.toString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1571,11 +1658,13 @@ test('send stale message on prs when stale-pr-message is not empty', async () =>
'An issue that should be marked stale but not closed', 'An issue that should be marked stale but not closed',
lastUpdate.toString(), lastUpdate.toString(),
lastUpdate.toString(), lastUpdate.toString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1611,12 +1700,14 @@ test('git branch is deleted when option is enabled', async () => {
'An issue that should have its branch deleted', 'An issue that should have its branch deleted',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
isPullRequest, isPullRequest,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1640,12 +1731,14 @@ test('git branch is not deleted when issue is not pull request', async () => {
'An issue that should not have its branch deleted', 'An issue that should not have its branch deleted',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
isPullRequest, isPullRequest,
['Stale'] ['Stale']
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1669,6 +1762,7 @@ test('an issue without a milestone will be marked as stale', async () => {
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1677,6 +1771,7 @@ test('an issue without a milestone will be marked as stale', async () => {
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
DefaultProcessorOptions, DefaultProcessorOptions,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1702,6 +1797,7 @@ test('an issue without an exempted milestone will be marked as stale', async ()
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1710,6 +1806,7 @@ test('an issue without an exempted milestone will be marked as stale', async ()
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1735,6 +1832,7 @@ test('an issue with an exempted milestone will not be marked as stale', async ()
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1743,6 +1841,7 @@ test('an issue with an exempted milestone will not be marked as stale', async ()
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1768,6 +1867,7 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1776,6 +1876,7 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1801,6 +1902,7 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1809,6 +1911,7 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1835,6 +1938,7 @@ test('an issue with an exempted milestone but without an exempted issue mileston
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1843,6 +1947,7 @@ test('an issue with an exempted milestone but without an exempted issue mileston
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1869,6 +1974,7 @@ test('an issue with an exempted milestone but with another exempted issue milest
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1877,6 +1983,7 @@ test('an issue with an exempted milestone but with another exempted issue milest
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1903,6 +2010,7 @@ test('an issue with an exempted milestone and with an exempted issue milestone w
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false, false,
false,
undefined, undefined,
undefined, undefined,
undefined, undefined,
@ -1911,6 +2019,7 @@ test('an issue with an exempted milestone and with an exempted issue milestone w
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1938,6 +2047,7 @@ test('processing an issue opened since 2 days and with the option "daysBeforeIss
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1964,6 +2074,7 @@ test('processing an issue opened since 2 days and with the option "daysBeforeIss
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -1990,6 +2101,7 @@ test('processing an issue opened since 2 days and with the option "daysBeforeIss
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2016,6 +2128,7 @@ test('processing an issue opened since 1 hour and with the option "daysBeforeIss
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toISOString() async () => new Date().toISOString()
@ -2042,6 +2155,7 @@ test('processing an issue opened since 4 hours and with the option "daysBeforeIs
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toISOString() async () => new Date().toISOString()
@ -2068,6 +2182,7 @@ test('processing an issue opened since 5 hours and with the option "daysBeforeIs
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toISOString() async () => new Date().toISOString()
@ -2096,11 +2211,13 @@ test('processing a pull request opened since 2 days and with the option "daysBef
'A pull request with no label', 'A pull request with no label',
issueDate.toDateString(), issueDate.toDateString(),
issueDate.toDateString(), issueDate.toDateString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2129,11 +2246,13 @@ test('processing a pull request opened since 2 days and with the option "daysBef
'A pull request with no label', 'A pull request with no label',
issueDate.toDateString(), issueDate.toDateString(),
issueDate.toDateString(), issueDate.toDateString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2162,11 +2281,13 @@ test('processing a pull request opened since 2 days and with the option "daysBef
'A pull request with no label', 'A pull request with no label',
issueDate.toDateString(), issueDate.toDateString(),
issueDate.toDateString(), issueDate.toDateString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2195,11 +2316,13 @@ test('processing a pull request opened since 1 hour and with the option "daysBef
'A pull request with no label', 'A pull request with no label',
issueDate.toISOString(), issueDate.toISOString(),
issueDate.toISOString(), issueDate.toISOString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toISOString() async () => new Date().toISOString()
@ -2228,11 +2351,13 @@ test('processing a pull request opened since 4 hours and with the option "daysBe
'A pull request with no label', 'A pull request with no label',
issueDate.toISOString(), issueDate.toISOString(),
issueDate.toISOString(), issueDate.toISOString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toISOString() async () => new Date().toISOString()
@ -2261,11 +2386,13 @@ test('processing a pull request opened since 5 hours and with the option "daysBe
'A pull request with no label', 'A pull request with no label',
issueDate.toISOString(), issueDate.toISOString(),
issueDate.toISOString(), issueDate.toISOString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toISOString() async () => new Date().toISOString()
@ -2295,6 +2422,7 @@ test('processing a previously closed issue with a close label will remove the cl
oneWeekAgo.toDateString(), oneWeekAgo.toDateString(),
now.toDateString(), now.toDateString(),
false, false,
false,
['close'], ['close'],
false, false,
false false
@ -2302,6 +2430,7 @@ test('processing a previously closed issue with a close label will remove the cl
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2330,6 +2459,7 @@ test('processing a closed issue with a close label will not remove the close lab
oneWeekAgo.toDateString(), oneWeekAgo.toDateString(),
now.toDateString(), now.toDateString(),
false, false,
false,
['close'], ['close'],
true, true,
false false
@ -2337,6 +2467,7 @@ test('processing a closed issue with a close label will not remove the close lab
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2365,6 +2496,7 @@ test('processing a locked issue with a close label will not remove the close lab
oneWeekAgo.toDateString(), oneWeekAgo.toDateString(),
now.toDateString(), now.toDateString(),
false, false,
false,
['close'], ['close'],
false, false,
true true
@ -2372,6 +2504,7 @@ test('processing a locked issue with a close label will not remove the close lab
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2404,6 +2537,7 @@ test('processing an issue stale since less than the daysBeforeStale with a stale
updatedAt.toDateString(), updatedAt.toDateString(),
new Date(2021, 0, 16).toDateString(), new Date(2021, 0, 16).toDateString(),
false, false,
false,
['stale-label'], // This was the problem for the user BTW, the issue was re-opened without removing the previous stale label ['stale-label'], // This was the problem for the user BTW, the issue was re-opened without removing the previous stale label
false, false,
false false
@ -2411,6 +2545,7 @@ test('processing an issue stale since less than the daysBeforeStale with a stale
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async (): Promise<IComment[]> => Promise.resolve([]), async (): Promise<IComment[]> => Promise.resolve([]),
async () => labelCreatedAt.toDateString() async () => labelCreatedAt.toDateString()
@ -2444,6 +2579,7 @@ test('processing an issue stale since less than the daysBeforeStale without a st
updatedAt.toDateString(), updatedAt.toDateString(),
new Date(2021, 0, 16).toDateString(), new Date(2021, 0, 16).toDateString(),
false, false,
false,
[], [],
false, false,
false false
@ -2451,6 +2587,7 @@ test('processing an issue stale since less than the daysBeforeStale without a st
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async (): Promise<IComment[]> => Promise.resolve([]), async (): Promise<IComment[]> => Promise.resolve([]),
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2481,11 +2618,13 @@ test('processing a pull request to be stale with the "stalePrMessage" option set
'A pull request with no label and a stale message', 'A pull request with no label and a stale message',
issueDate.toDateString(), issueDate.toDateString(),
issueDate.toDateString(), issueDate.toDateString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2516,11 +2655,13 @@ test('processing a pull request to be stale with the "stalePrMessage" option set
'A pull request with no label and a stale message', 'A pull request with no label and a stale message',
issueDate.toDateString(), issueDate.toDateString(),
issueDate.toDateString(), issueDate.toDateString(),
false,
true true
) )
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2552,6 +2693,7 @@ test('processing an issue with the "includeOnlyAssigned" option and nonempty ass
issueDate.toDateString(), issueDate.toDateString(),
issueDate.toDateString(), issueDate.toDateString(),
false, false,
false,
[], [],
false, false,
false, false,
@ -2561,6 +2703,7 @@ test('processing an issue with the "includeOnlyAssigned" option and nonempty ass
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()
@ -2588,6 +2731,7 @@ test('processing an issue with the "includeOnlyAssigned" option set and no assig
]; ];
const processor = new IssuesProcessorMock( const processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? TestIssueList : []), async p => (p === 1 ? TestIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

View File

@ -3,6 +3,7 @@ import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-option
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
interface ITestData { interface ITestData {
isPullRequest: boolean; isPullRequest: boolean;
@ -27,6 +28,7 @@ describe('milestones options', (): void => {
'My first issue', 'My first issue',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z', '2020-01-01T17:00:00Z',
false,
isPullRequest, isPullRequest,
undefined, undefined,
undefined, undefined,
@ -39,6 +41,7 @@ describe('milestones options', (): void => {
const setProcessor = () => { const setProcessor = () => {
processor = new IssuesProcessorMock( processor = new IssuesProcessorMock(
opts, opts,
alwaysFalseStateMock,
async p => (p === 1 ? testIssueList : []), async p => (p === 1 ? testIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

View File

@ -4,6 +4,7 @@ import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-option
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
let issuesProcessorBuilder: IssuesProcessorBuilder; let issuesProcessorBuilder: IssuesProcessorBuilder;
let issuesProcessor: IssuesProcessorMock; let issuesProcessor: IssuesProcessorMock;
@ -1102,6 +1103,7 @@ class IssuesProcessorBuilder {
issue.title ?? 'dummy-title', issue.title ?? 'dummy-title',
issue.updated_at ?? new Date().toDateString(), issue.updated_at ?? new Date().toDateString(),
issue.created_at ?? new Date().toDateString(), issue.created_at ?? new Date().toDateString(),
false,
!!issue.pull_request, !!issue.pull_request,
issue.labels ? issue.labels.map(label => label.name || '') : [] issue.labels ? issue.labels.map(label => label.name || '') : []
) )
@ -1139,6 +1141,7 @@ class IssuesProcessorBuilder {
build(): IssuesProcessorMock { build(): IssuesProcessorMock {
return new IssuesProcessorMock( return new IssuesProcessorMock(
this._options, this._options,
alwaysFalseStateMock,
async p => (p === 1 ? this._issues : []), async p => (p === 1 ? this._issues : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

View File

@ -4,6 +4,7 @@ import {IsoDateString} from '../src/types/iso-date-string';
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock, StateMock} from './classes/state-mock';
describe('operations-per-run option', (): void => { describe('operations-per-run option', (): void => {
let sut: SUT; let sut: SUT;
@ -205,6 +206,7 @@ class SUT {
private async _setProcessor(): Promise<number> { private async _setProcessor(): Promise<number> {
this.processor = new IssuesProcessorMock( this.processor = new IssuesProcessorMock(
this._opts, this._opts,
alwaysFalseStateMock,
async p => (p === 1 ? this._testIssueList : []), async p => (p === 1 ? this._testIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

View File

@ -5,6 +5,7 @@ import {ILabel} from '../src/interfaces/label';
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
let issuesProcessorBuilder: IssuesProcessorBuilder; let issuesProcessorBuilder: IssuesProcessorBuilder;
let issuesProcessor: IssuesProcessorMock; let issuesProcessor: IssuesProcessorMock;
@ -141,7 +142,9 @@ describe('remove-issue-stale-when-updated option', (): void => {
test('should not remove the stale label on the pull request', async (): Promise<void> => { test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1); expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); issuesProcessor = issuesProcessorBuilder
.stalePrs([{draft: true}])
.build();
await issuesProcessor.processIssues(); await issuesProcessor.processIssues();
@ -454,6 +457,7 @@ class IssuesProcessorBuilder {
issue.title ?? 'dummy-title', issue.title ?? 'dummy-title',
issue.updated_at ?? new Date().toDateString(), issue.updated_at ?? new Date().toDateString(),
issue.created_at ?? new Date().toDateString(), issue.created_at ?? new Date().toDateString(),
!!issue.draft,
!!issue.pull_request, !!issue.pull_request,
issue.labels ? issue.labels.map(label => label.name || '') : [] issue.labels ? issue.labels.map(label => label.name || '') : []
) )
@ -515,7 +519,7 @@ class IssuesProcessorBuilder {
stalePrs(issues: Partial<IIssue>[]): IssuesProcessorBuilder { stalePrs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.prs( this.prs(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => { issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return { const o = {
...issue, ...issue,
updated_at: '2020-01-01T17:00:00Z', updated_at: '2020-01-01T17:00:00Z',
created_at: '2020-01-01T17:00:00Z', created_at: '2020-01-01T17:00:00Z',
@ -530,6 +534,7 @@ class IssuesProcessorBuilder {
} }
] ]
}; };
return o;
}) })
); );
@ -539,6 +544,7 @@ class IssuesProcessorBuilder {
build(): IssuesProcessorMock { build(): IssuesProcessorMock {
return new IssuesProcessorMock( return new IssuesProcessorMock(
this._options, this._options,
alwaysFalseStateMock,
async p => (p === 1 ? this._issues : []), async p => (p === 1 ? this._issues : []),
async () => [ async () => [
{ {

213
__tests__/state.spec.ts Normal file
View File

@ -0,0 +1,213 @@
import {IStateStorage} from '../src/interfaces/state/state-storage';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {Issue} from '../src/classes/issue';
import {generateIssue} from './functions/generate-issue';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {IssueID, State} from '../src/classes/state/state';
import {IState} from '../src/interfaces/state/state';
import * as core from '@actions/core';
const stateStorage: IStateStorage = {
restore(): Promise<string> {
return Promise.resolve('');
},
save(serializedState: string): Promise<void> {
return Promise.resolve();
}
};
const getProcessedIssuesIDs = (state: IState): Set<IssueID> =>
(state as unknown as {processedIssuesIDs: Set<IssueID>}).processedIssuesIDs;
describe('state', (): void => {
let debugSpy: jest.SpyInstance;
let infoSpy: jest.SpyInstance;
let warningSpy: jest.SpyInstance;
beforeEach(() => {
debugSpy = jest.spyOn(core, 'debug');
infoSpy = jest.spyOn(core, 'info');
warningSpy = jest.spyOn(core, 'warning');
});
afterEach(() => {
jest.resetAllMocks();
jest.clearAllMocks();
});
it('rehydrate/persist should not be called during processing', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
daysBeforeClose: 0
};
const TestIssueList: Issue[] = [
generateIssue(opts, 1, 'An issue with no label', '2020-01-01T17:00:00Z')
];
const state = new State(stateStorage, opts);
const restoreSpy = jest.spyOn(stateStorage, 'restore');
const saveSpy = jest.spyOn(stateStorage, 'save');
const processor = new IssuesProcessorMock(
opts,
state,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
expect(restoreSpy).toHaveBeenCalledTimes(0);
expect(saveSpy).toHaveBeenCalledTimes(0);
});
it('state should be marked with the processed issue', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
daysBeforeClose: 0
};
const testIssue1 = generateIssue(
opts,
1,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const TestIssueList: Issue[] = [testIssue1];
const state = new State(stateStorage, opts);
const addIssueToProcessedSpy = jest.spyOn(state, 'addIssueToProcessed');
const processor = new IssuesProcessorMock(
opts,
state,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
expect(addIssueToProcessedSpy).toHaveBeenCalledTimes(1);
expect(addIssueToProcessedSpy).toHaveBeenCalledWith(testIssue1);
expect(debugSpy).toHaveBeenCalledWith('state: reset');
expect(debugSpy).toHaveBeenCalledWith('state: mark 1 as processed');
});
it('issueProcessor should skip the issue marked as proceeded', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
daysBeforeClose: 0
};
const testIssue1 = generateIssue(
opts,
1,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const testIssue2 = generateIssue(
opts,
2,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const TestIssueList: Issue[] = [testIssue1, testIssue2];
const state = new State(stateStorage, opts);
state.addIssueToProcessed(testIssue1);
debugSpy.mockClear();
const addIssueToProcessedSpy = jest.spyOn(state, 'addIssueToProcessed');
const isIssueProcessedSpy = jest.spyOn(state, 'isIssueProcessed');
const processor = new IssuesProcessorMock(
opts,
state,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
expect(addIssueToProcessedSpy).toHaveBeenCalledTimes(1);
expect(addIssueToProcessedSpy).toHaveBeenCalledWith(testIssue2);
expect(isIssueProcessedSpy).toHaveBeenCalledTimes(2);
expect(isIssueProcessedSpy).toHaveBeenCalledWith(testIssue1);
expect(isIssueProcessedSpy).toHaveBeenCalledWith(testIssue2);
expect(processor.staleIssues.length).toStrictEqual(1);
expect(processor.closedIssues.length).toStrictEqual(1);
expect(debugSpy).toHaveBeenCalledWith('state: reset');
expect(debugSpy).toHaveBeenCalledWith('state: mark 2 as processed');
});
it('state should not be reset if not all issues are proceeded', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
operationsPerRun: 1,
daysBeforeClose: 0
};
const testIssue1 = generateIssue(
opts,
1,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const testIssue2 = generateIssue(
opts,
2,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const TestIssueList: Issue[] = [testIssue1, testIssue2];
const state = new State(stateStorage, opts);
const resetSpy = jest.spyOn(state, 'reset');
const processor = new IssuesProcessorMock(
opts,
state,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
// make sure not all issues are proceeded
expect(warningSpy.mock.calls[2][0]).toContain(
'No more operations left! Exiting...'
);
expect(resetSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledWith('state: mark 1 as processed');
});
it('state should be reset if all issues are proceeded', async () => {
const opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
daysBeforeClose: 0
};
const testIssue1 = generateIssue(
opts,
1,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const testIssue2 = generateIssue(
opts,
2,
'An issue with no label',
'2020-01-01T17:00:00Z'
);
const TestIssueList: Issue[] = [testIssue1, testIssue2];
const state = new State(stateStorage, opts);
const resetSpy = jest.spyOn(state, 'reset');
const processor = new IssuesProcessorMock(
opts,
state,
async p => (p === 1 ? TestIssueList : []),
async () => [],
async () => new Date().toDateString()
);
await processor.processIssues(1);
// make sure all issues are proceeded
expect(infoSpy.mock.calls[71][0]).toContain(
'No more issues found to process. Exiting...'
);
expect(resetSpy).toHaveBeenCalledTimes(1);
expect(debugSpy).toHaveBeenCalledWith('state: mark 1 as processed');
expect(debugSpy).toHaveBeenCalledWith('state: mark 2 as processed');
});
});

View File

@ -4,6 +4,7 @@ import {IsoDateString} from '../src/types/iso-date-string';
import {IssuesProcessorMock} from './classes/issues-processor-mock'; import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options'; import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue'; import {generateIssue} from './functions/generate-issue';
import {alwaysFalseStateMock} from './classes/state-mock';
describe('ignore-updates options', (): void => { describe('ignore-updates options', (): void => {
let sut: SUT; let sut: SUT;
@ -676,6 +677,7 @@ class SUT {
'My first issue', 'My first issue',
this._updatedAt, this._updatedAt,
this._createdAt, this._createdAt,
false,
this._isPullRequest this._isPullRequest
) )
]; ];
@ -686,6 +688,7 @@ class SUT {
private async _setProcessor(): Promise<number> { private async _setProcessor(): Promise<number> {
this.processor = new IssuesProcessorMock( this.processor = new IssuesProcessorMock(
this._opts, this._opts,
alwaysFalseStateMock,
async p => (p === 1 ? this._testIssueList : []), async p => (p === 1 ? this._testIssueList : []),
async () => [], async () => [],
async () => new Date().toDateString() async () => new Date().toDateString()

53454
dist/index.js vendored

File diff suppressed because one or more lines are too long

7274
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,6 +37,7 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^3.2.1",
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/github": "^5.1.1", "@actions/github": "^5.1.1",
"@octokit/core": "^4.2.0", "@octokit/core": "^4.2.0",

View File

@ -17,6 +17,8 @@ export class ExemptDraftPullRequest {
} }
async shouldExemptDraftPullRequest( async shouldExemptDraftPullRequest(
// keep this for backward compatibility
// eslint-disable-next-line @typescript-eslint/no-unused-vars
pullRequestCallback: () => Promise<IPullRequest | undefined | void> pullRequestCallback: () => Promise<IPullRequest | undefined | void>
): Promise<boolean> { ): Promise<boolean> {
if (this._issue.isPullRequest) { if (this._issue.isPullRequest) {
@ -27,10 +29,13 @@ export class ExemptDraftPullRequest {
)} is enabled` )} is enabled`
); );
/* This code was used until Jun 15 2022 - it is unclear why they had to call API for getting pull request
const pullRequest: IPullRequest | undefined | void = const pullRequest: IPullRequest | undefined | void =
await pullRequestCallback(); await pullRequestCallback();
if (pullRequest?.draft === true) { if (pullRequest?.draft === true) {
*/
if (this._issue?.draft === true) {
this._issueLogger.info( this._issueLogger.info(
LoggerService.white('└──'), LoggerService.white('└──'),
`Skip the $$type draft checks` `Skip the $$type draft checks`

View File

@ -71,6 +71,7 @@ describe('Issue', (): void => {
number: 8, number: 8,
created_at: 'dummy-created-at', created_at: 'dummy-created-at',
updated_at: 'dummy-updated-at', updated_at: 'dummy-updated-at',
draft: false,
labels: [ labels: [
{ {
name: 'dummy-name' name: 'dummy-name'

View File

@ -13,6 +13,7 @@ export class Issue implements IIssue {
readonly number: number; readonly number: number;
created_at: IsoDateString; created_at: IsoDateString;
updated_at: IsoDateString; updated_at: IsoDateString;
readonly draft: boolean;
readonly labels: ILabel[]; readonly labels: ILabel[];
readonly pull_request: object | null | undefined; readonly pull_request: object | null | undefined;
readonly state: string | 'closed' | 'open'; readonly state: string | 'closed' | 'open';
@ -33,6 +34,7 @@ export class Issue implements IIssue {
this.number = issue.number; this.number = issue.number;
this.created_at = issue.created_at; this.created_at = issue.created_at;
this.updated_at = issue.updated_at; this.updated_at = issue.updated_at;
this.draft = Boolean(issue.draft);
this.labels = mapLabels(issue.labels); this.labels = mapLabels(issue.labels);
this.pull_request = issue.pull_request; this.pull_request = issue.pull_request;
this.state = issue.state; this.state = issue.state;

View File

@ -26,6 +26,7 @@ import {Statistics} from './statistics';
import {LoggerService} from '../services/logger.service'; import {LoggerService} from '../services/logger.service';
import {OctokitIssue} from '../interfaces/issue'; import {OctokitIssue} from '../interfaces/issue';
import {retry} from '@octokit/plugin-retry'; import {retry} from '@octokit/plugin-retry';
import {IState} from '../interfaces/state/state';
/*** /***
* Handle processing of issues for staleness/closure. * Handle processing of issues for staleness/closure.
@ -72,9 +73,11 @@ export class IssuesProcessor {
readonly addedCloseCommentIssues: Issue[] = []; readonly addedCloseCommentIssues: Issue[] = [];
readonly statistics: Statistics | undefined; readonly statistics: Statistics | undefined;
private readonly _logger: Logger = new Logger(); private readonly _logger: Logger = new Logger();
private readonly state: IState;
constructor(options: IIssuesProcessorOptions) { constructor(options: IIssuesProcessorOptions, state: IState) {
this.options = options; this.options = options;
this.state = state;
this.client = getOctokit(this.options.repoToken, undefined, retry); this.client = getOctokit(this.options.repoToken, undefined, retry);
this.operations = new StaleOperations(this.options); this.operations = new StaleOperations(this.options);
@ -110,6 +113,8 @@ export class IssuesProcessor {
?.setOperationsCount(this.operations.getConsumedOperationsCount()) ?.setOperationsCount(this.operations.getConsumedOperationsCount())
.logStats(); .logStats();
this.state.reset();
return this.operations.getRemainingOperationsCount(); return this.operations.getRemainingOperationsCount();
} else { } else {
this._logger.info( this._logger.info(
@ -141,6 +146,12 @@ export class IssuesProcessor {
} }
const issueLogger: IssueLogger = new IssueLogger(issue); const issueLogger: IssueLogger = new IssueLogger(issue);
if (this.state.isIssueProcessed(issue)) {
issueLogger.info(
' $$type skipped due being processed during the previous run'
);
continue;
}
await issueLogger.grouping(`$$type #${issue.number}`, async () => { await issueLogger.grouping(`$$type #${issue.number}`, async () => {
await this.processIssue( await this.processIssue(
issue, issue,
@ -149,6 +160,7 @@ export class IssuesProcessor {
labelsToRemoveWhenStale labelsToRemoveWhenStale
); );
}); });
this.state.addIssueToProcessed(issue);
} }
if (!this.operations.hasRemainingOperations()) { if (!this.operations.hasRemainingOperations()) {
@ -561,7 +573,8 @@ export class IssuesProcessor {
this.statistics?.incrementFetchedItemsCount(issueResult.data.length); this.statistics?.incrementFetchedItemsCount(issueResult.data.length);
return issueResult.data.map( return issueResult.data.map(
(issue: Readonly<OctokitIssue>): Issue => new Issue(this.options, issue) (issue): Issue =>
new Issue(this.options, issue as Readonly<OctokitIssue>)
); );
} catch (error) { } catch (error) {
throw Error(`Getting issues was blocked by the error: ${error.message}`); throw Error(`Getting issues was blocked by the error: ${error.message}`);

View File

@ -0,0 +1,99 @@
import {IStateStorage} from '../../interfaces/state/state-storage';
import fs from 'fs';
import path from 'path';
import os from 'os';
import * as core from '@actions/core';
import {getOctokit} from '@actions/github';
import {retry as octokitRetry} from '@octokit/plugin-retry';
import * as cache from '@actions/cache';
const CACHE_KEY = '_state';
const STATE_FILE = 'state.txt';
const STALE_DIR = '56acbeaa-1fef-4c79-8f84-7565e560fb03';
const mkTempDir = (): string => {
const tmpDir = path.join(os.tmpdir(), STALE_DIR);
fs.mkdirSync(tmpDir, {recursive: true});
return tmpDir;
};
const unlinkSafely = (filePath: string) => {
try {
fs.unlinkSync(filePath);
} catch (foo) {
/* ignore */
}
};
const resetCacheWithOctokit = async (cacheKey: string): Promise<void> => {
const token = core.getInput('repo-token');
const client = getOctokit(token, undefined, octokitRetry);
// TODO: better way to get repository?
const repo = process.env['GITHUB_REPOSITORY'];
core.debug(`remove cache "${cacheKey}"`);
try {
// TODO: replace with client.rest.
await client.request(
`DELETE /repos/${repo}/actions/caches?key=${cacheKey}`
);
} catch (error) {
if (error.status) {
core.debug(`Cache ${cacheKey} does not exist`);
} else {
throw error;
}
}
};
export class StateCacheStorage implements IStateStorage {
async save(serializedState: string): Promise<void> {
const tmpDir = mkTempDir();
const filePath = path.join(tmpDir, STATE_FILE);
fs.writeFileSync(filePath, serializedState);
try {
await resetCacheWithOctokit(CACHE_KEY);
const fileSize = fs.statSync(filePath).size;
if (fileSize === 0) {
core.info(`the state will be removed`);
return;
}
await cache.saveCache([path.dirname(filePath)], CACHE_KEY);
} catch (error) {
core.warning(
`Saving the state was not successful due to "${
error.message || 'unknown reason'
}"`
);
} finally {
unlinkSafely(filePath);
}
}
async restore(): Promise<string> {
const tmpDir = mkTempDir();
const filePath = path.join(tmpDir, STATE_FILE);
unlinkSafely(filePath);
try {
await cache.restoreCache([path.dirname(filePath)], CACHE_KEY);
if (!fs.existsSync(filePath)) {
core.info(
'The stored state has not been found, probably because of the very first run or the previous run failed'
);
return '';
}
return fs.readFileSync(path.join(tmpDir, STATE_FILE), {
encoding: 'utf8'
});
} catch (error) {
core.warning(
`Restoring the state was not successful due to "${
error.message || 'unknown reason'
}"`
);
return '';
}
}
}

View File

@ -0,0 +1,161 @@
import {IssueID, State} from './state';
import {IIssuesProcessorOptions} from '../../interfaces/issues-processor-options';
import {IIssue} from '../../interfaces/issue';
import {IState} from '../../interfaces/state/state';
import * as core from '@actions/core';
const mockStorage = {
save: () => Promise.resolve(),
restore: () => Promise.resolve('')
};
const getProcessedIssuesIDs = (state: IState): Set<IssueID> =>
(state as unknown as {processedIssuesIDs: Set<IssueID>}).processedIssuesIDs;
describe('State', () => {
let debugSpy: jest.SpyInstance;
let infoSpy: jest.SpyInstance;
let warningSpy: jest.SpyInstance;
beforeEach(() => {
debugSpy = jest.spyOn(core, 'debug');
infoSpy = jest.spyOn(core, 'info');
warningSpy = jest.spyOn(core, 'warning');
});
afterEach(() => {
jest.resetAllMocks();
jest.clearAllMocks();
});
describe('initializing and resetting', () => {
it('new state should not contain any issues marked as proceeded', async () => {
const state = new State(
mockStorage,
{} as unknown as IIssuesProcessorOptions
);
expect(getProcessedIssuesIDs(state)).toEqual(new Set());
expect(debugSpy).not.toHaveBeenCalled();
});
it('reset state should not contain any issues marked as proceeded', async () => {
const state = new State(
mockStorage,
{} as unknown as IIssuesProcessorOptions
);
state.addIssueToProcessed({number: 1} as unknown as IIssue);
expect(getProcessedIssuesIDs(state)).not.toEqual(new Set());
state.reset();
expect(getProcessedIssuesIDs(state)).toEqual(new Set());
expect(debugSpy).toHaveBeenCalledTimes(2);
expect(debugSpy).toHaveBeenCalledWith('state: reset');
});
});
describe('marking as proceeded', () => {
it('state marked with issues 1,2,3 as proceeded should report the as proceeded', async () => {
const state = new State(
mockStorage,
{} as unknown as IIssuesProcessorOptions
);
state.addIssueToProcessed({number: 1} as unknown as IIssue);
state.addIssueToProcessed({number: 2} as unknown as IIssue);
state.addIssueToProcessed({number: 3} as unknown as IIssue);
expect(getProcessedIssuesIDs(state)).toEqual(new Set([1, 2, 3]));
expect(
state.isIssueProcessed({number: 1} as unknown as IIssue)
).toBeTruthy();
expect(
state.isIssueProcessed({number: 2} as unknown as IIssue)
).toBeTruthy();
expect(
state.isIssueProcessed({number: 3} as unknown as IIssue)
).toBeTruthy();
expect(
state.isIssueProcessed({number: 0} as unknown as IIssue)
).toBeFalsy();
expect(
state.isIssueProcessed({number: 4} as unknown as IIssue)
).toBeFalsy();
expect(debugSpy).toHaveBeenCalledTimes(3);
expect(debugSpy).toHaveBeenCalledWith('state: mark 1 as processed');
expect(debugSpy).toHaveBeenCalledWith('state: mark 2 as processed');
expect(debugSpy).toHaveBeenCalledWith('state: mark 3 as processed');
});
});
describe('persisting', () => {
it('[1,2,3] should be serialized and persisted as to "1|2|3|', async () => {
const mockStorage = {
save: jest.fn().mockReturnValue(Promise.resolve()),
async restore(): Promise<string> {
return '';
}
};
const state = new State(
mockStorage,
{} as unknown as IIssuesProcessorOptions
);
state.addIssueToProcessed({number: 1} as unknown as IIssue);
state.addIssueToProcessed({number: 2} as unknown as IIssue);
state.addIssueToProcessed({number: 3} as unknown as IIssue);
await state.persist();
expect(mockStorage.save).toHaveBeenCalledTimes(1);
expect(mockStorage.save).toHaveBeenCalledWith('1|2|3');
expect(infoSpy).toHaveBeenCalledTimes(1);
expect(infoSpy).toHaveBeenCalledWith(
'state: persisting info about 3 issue(s)'
);
});
});
describe('rehydrating', () => {
it('"1|2|3" should be rehydrate to the IState with issues 1,2,3 marked as proceeded', async () => {
const mockStorage = {
save: () => Promise.resolve(),
restore: () => Promise.resolve('1|2|3')
};
const state = new State(
mockStorage,
{} as unknown as IIssuesProcessorOptions
);
await state.restore();
const processedIssuesIDs = (
state as unknown as {processedIssuesIDs: Set<IssueID>}
).processedIssuesIDs;
expect(processedIssuesIDs).toEqual(new Set([1, 2, 3]));
expect(infoSpy).toHaveBeenCalledTimes(1);
expect(infoSpy).toHaveBeenCalledWith(
'state: restored with info about 3 issue(s)'
);
});
});
describe('debugOnly', () => {
it('state should persisted if debugOnly not set', () => {
const mockStorage = {
save: jest.fn().mockReturnValue(Promise.resolve()),
async restore(): Promise<string> {
return '';
}
};
const state = new State(
mockStorage,
{} as unknown as IIssuesProcessorOptions
);
state.persist();
expect(mockStorage.save).toHaveBeenCalledTimes(1);
});
it('state should not be persisted if debugOnly set true', () => {
const mockStorage = {
save: jest.fn().mockReturnValue(Promise.resolve()),
async restore(): Promise<string> {
return '';
}
};
const state = new State(mockStorage, {
debugOnly: true
} as unknown as IIssuesProcessorOptions);
state.persist();
expect(mockStorage.save).not.toHaveBeenCalled();
expect(warningSpy).toHaveBeenCalledTimes(1);
expect(warningSpy).toHaveBeenCalledWith(
'The state is not persisted in the debug mode'
);
});
});
});

View File

@ -0,0 +1,71 @@
import {IState} from '../../interfaces/state/state';
import * as core from '@actions/core';
import {IIssuesProcessorOptions} from '../../interfaces/issues-processor-options';
import {IStateStorage} from '../../interfaces/state/state-storage';
import {IIssue} from '../../interfaces/issue';
export type IssueID = number;
export class NoStateError extends Error {}
export class State implements IState {
/**
* @private don't mutate in the debug mode
*/
private readonly debug: boolean;
private readonly processedIssuesIDs: Set<IssueID>;
private readonly stateStorage: IStateStorage;
constructor(stateStorage: IStateStorage, options: IIssuesProcessorOptions) {
this.debug = options.debugOnly;
this.processedIssuesIDs = new Set();
this.stateStorage = stateStorage;
}
isIssueProcessed(issue: IIssue) {
return this.processedIssuesIDs.has(issue.number);
}
addIssueToProcessed(issue: IIssue) {
core.debug(`state: mark ${issue.number} as processed`);
this.processedIssuesIDs.add(issue.number);
}
reset() {
core.debug('state: reset');
this.processedIssuesIDs.clear();
}
private deserialize(serialized: string) {
const issueIDs = serialized
.split('|')
.map(id => parseInt(id))
.filter(i => !isNaN(i));
this.processedIssuesIDs.clear();
issueIDs.forEach(issueID => this.processedIssuesIDs.add(issueID));
}
private get serialized(): string {
return Array.from(this.processedIssuesIDs).join('|');
}
async persist(): Promise<void> {
if (this.debug) {
core.warning('The state is not persisted in the debug mode');
return;
}
core.info(
`state: persisting info about ${this.processedIssuesIDs.size} issue(s)`
);
return this.stateStorage.save(this.serialized);
}
async restore(): Promise<void> {
this.reset();
const serialized = await this.stateStorage.restore();
this.deserialize(serialized);
core.info(
`state: restored with info about ${this.processedIssuesIDs.size} issue(s)`
);
}
}

View File

@ -8,6 +8,7 @@ export interface IIssue {
number: number; number: number;
created_at: IsoDateString; created_at: IsoDateString;
updated_at: IsoDateString; updated_at: IsoDateString;
draft: boolean;
labels: ILabel[]; labels: ILabel[];
pull_request?: object | null; pull_request?: object | null;
state: string; state: string;

View File

@ -0,0 +1,4 @@
export interface IStateStorage {
save(serializedState: string): Promise<void>;
restore(): Promise<string>;
}

View File

@ -0,0 +1,9 @@
import {IIssue} from '../issue';
export interface IState {
isIssueProcessed(issue: IIssue): boolean;
addIssueToProcessed(issue: IIssue): void;
reset(): void;
persist(): Promise<void>;
restore(): Promise<void>;
}

View File

@ -3,14 +3,20 @@ import {IssuesProcessor} from './classes/issues-processor';
import {isValidDate} from './functions/dates/is-valid-date'; import {isValidDate} from './functions/dates/is-valid-date';
import {IIssuesProcessorOptions} from './interfaces/issues-processor-options'; import {IIssuesProcessorOptions} from './interfaces/issues-processor-options';
import {Issue} from './classes/issue'; import {Issue} from './classes/issue';
import {getStateInstance} from './services/state.service';
async function _run(): Promise<void> { async function _run(): Promise<void> {
try { try {
const args = _getAndValidateArgs(); const args = _getAndValidateArgs();
const issueProcessor: IssuesProcessor = new IssuesProcessor(args); const state = getStateInstance(args);
await state.restore();
const issueProcessor: IssuesProcessor = new IssuesProcessor(args, state);
await issueProcessor.processIssues(); await issueProcessor.processIssues();
await state.persist();
await processOutput( await processOutput(
issueProcessor.staleIssues, issueProcessor.staleIssues,
issueProcessor.closedIssues issueProcessor.closedIssues

View File

@ -0,0 +1,9 @@
import {IState} from '../interfaces/state/state';
import {State} from '../classes/state/state';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {StateCacheStorage} from '../classes/state/state-cache-storage';
export const getStateInstance = (options: IIssuesProcessorOptions): IState => {
const storage = new StateCacheStorage();
return new State(storage, options);
};